linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] dt-bindings: power: define ID for Marvell PXA1908 audio domain
@ 2025-12-13  8:48 Karel Balej
  2025-12-13  8:48 ` [PATCH v2 2/2] pmdomain: add audio power island for Marvell PXA1908 SoC Karel Balej
  0 siblings, 1 reply; 4+ messages in thread
From: Karel Balej @ 2025-12-13  8:48 UTC (permalink / raw)
  To: Duje Mihanović, Ulf Hansson, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, linux-arm-kernel, linux-pm,
	linux-kernel, devicetree
  Cc: ~postmarketos/upstreaming, phone-devel, Karel Balej,
	Krzysztof Kozlowski

Define an identifier for the SoC's audio power island so that it can be
referenced through device tree.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Duje Mihanović <duje@dujemihanovic.xyz>
Signed-off-by: Karel Balej <balejk@matfyz.cz>
---

Notes:
    v2:
    - Add received trailers (thanks!).
    - v1: https://lore.kernel.org/r/20251127190237.745-1-balejk@matfyz.cz/

 include/dt-bindings/power/marvell,pxa1908-power.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/dt-bindings/power/marvell,pxa1908-power.h b/include/dt-bindings/power/marvell,pxa1908-power.h
index 19b088351af1..173f47e0e69d 100644
--- a/include/dt-bindings/power/marvell,pxa1908-power.h
+++ b/include/dt-bindings/power/marvell,pxa1908-power.h
@@ -13,5 +13,6 @@
 #define PXA1908_POWER_DOMAIN_GPU2D	2
 #define PXA1908_POWER_DOMAIN_DSI	3
 #define PXA1908_POWER_DOMAIN_ISP	4
+#define PXA1908_POWER_DOMAIN_AUDIO	5
 
 #endif
-- 
2.51.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 2/2] pmdomain: add audio power island for Marvell PXA1908 SoC
  2025-12-13  8:48 [PATCH v2 1/2] dt-bindings: power: define ID for Marvell PXA1908 audio domain Karel Balej
@ 2025-12-13  8:48 ` Karel Balej
  2025-12-24 19:14   ` Duje Mihanović
  2025-12-29 11:49   ` Ulf Hansson
  0 siblings, 2 replies; 4+ messages in thread
From: Karel Balej @ 2025-12-13  8:48 UTC (permalink / raw)
  To: Duje Mihanović, Ulf Hansson, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, linux-arm-kernel, linux-pm,
	linux-kernel, devicetree
  Cc: ~postmarketos/upstreaming, phone-devel, Karel Balej

Define power domain which needs to be enabled in order for audio to work
on the PXA1908-based samsung,coreprimevelte smartphone. In the
downstream code, this power-on method is marked as specific to the ULCx
series which is allegedly a codename of sorts with ULC1 corresponding to
the PXA1908.

No other audio components needed for sound to work on this phone are
currently available mainline but some successful testing was performed
with the vendor variants of the respective drivers and with the domain
forced always-on.

Signed-off-by: Karel Balej <balejk@matfyz.cz>
---

Notes:
    v2:
    - APMU_AUD_CLK -> APMU_AUDIO_CLK and group it with other register
      definitions. (Duje)
    - Move default function exit path inside the switch. (Duje)
    - Modify the commit message with information provided by Duje (thanks!).

 .../marvell/pxa1908-power-controller.c        | 39 +++++++++++++++++--
 1 file changed, 35 insertions(+), 4 deletions(-)

diff --git a/drivers/pmdomain/marvell/pxa1908-power-controller.c b/drivers/pmdomain/marvell/pxa1908-power-controller.c
index ff5e6e82d3f8..543e8d33ac0c 100644
--- a/drivers/pmdomain/marvell/pxa1908-power-controller.c
+++ b/drivers/pmdomain/marvell/pxa1908-power-controller.c
@@ -24,12 +24,15 @@
 #define APMU_DEBUG		0x88
 #define DSI_PHY_DVM_MASK	BIT(31)
 
+#define APMU_AUDIO_CLK		0x80
+#define AUDIO_ULCX_ENABLE	0x0d
+
 #define POWER_ON_LATENCY_US	300
 #define POWER_OFF_LATENCY_US	20
 #define POWER_POLL_TIMEOUT_US	(25 * USEC_PER_MSEC)
 #define POWER_POLL_SLEEP_US	6
 
-#define NR_DOMAINS	5
+#define NR_DOMAINS	6
 
 #define to_pxa1908_pd(_genpd) container_of(_genpd, struct pxa1908_pd, genpd)
 
@@ -59,9 +62,14 @@ static inline bool pxa1908_pd_is_on(struct pxa1908_pd *pd)
 {
 	struct pxa1908_pd_ctrl *ctrl = pd->ctrl;
 
-	return pd->data.id != PXA1908_POWER_DOMAIN_DSI
-		? regmap_test_bits(ctrl->base, APMU_PWR_STATUS_REG, pd->data.pwr_state)
-		: regmap_test_bits(ctrl->base, APMU_DEBUG, DSI_PHY_DVM_MASK);
+	switch (pd->data.id) {
+	case PXA1908_POWER_DOMAIN_AUDIO:
+		return regmap_test_bits(ctrl->base, APMU_AUDIO_CLK, AUDIO_ULCX_ENABLE);
+	case PXA1908_POWER_DOMAIN_DSI:
+		return regmap_test_bits(ctrl->base, APMU_DEBUG, DSI_PHY_DVM_MASK);
+	default:
+		return regmap_test_bits(ctrl->base, APMU_PWR_STATUS_REG, pd->data.pwr_state);
+	}
 }
 
 static int pxa1908_pd_power_on(struct generic_pm_domain *genpd)
@@ -123,6 +131,22 @@ static inline int pxa1908_dsi_power_off(struct generic_pm_domain *genpd)
 	return regmap_clear_bits(ctrl->base, APMU_DEBUG, DSI_PHY_DVM_MASK);
 }
 
+static inline int pxa1908_audio_power_on(struct generic_pm_domain *genpd)
+{
+	struct pxa1908_pd *pd = to_pxa1908_pd(genpd);
+	struct pxa1908_pd_ctrl *ctrl = pd->ctrl;
+
+	return regmap_set_bits(ctrl->base, APMU_AUDIO_CLK, AUDIO_ULCX_ENABLE);
+}
+
+static inline int pxa1908_audio_power_off(struct generic_pm_domain *genpd)
+{
+	struct pxa1908_pd *pd = to_pxa1908_pd(genpd);
+	struct pxa1908_pd_ctrl *ctrl = pd->ctrl;
+
+	return regmap_clear_bits(ctrl->base, APMU_AUDIO_CLK, AUDIO_ULCX_ENABLE);
+}
+
 #define DOMAIN(_id, _name, ctrl, mode, state) \
 	[_id] = { \
 		.data = { \
@@ -159,6 +183,13 @@ static struct pxa1908_pd domains[NR_DOMAINS] = {
 			.keep_on = true,
 		},
 	},
+	[PXA1908_POWER_DOMAIN_AUDIO] = {
+		.genpd = {
+			.name = "audio",
+			.power_on = pxa1908_audio_power_on,
+			.power_off = pxa1908_audio_power_off,
+		},
+	},
 };
 
 static void pxa1908_pd_remove(struct auxiliary_device *auxdev)
-- 
2.51.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 2/2] pmdomain: add audio power island for Marvell PXA1908 SoC
  2025-12-13  8:48 ` [PATCH v2 2/2] pmdomain: add audio power island for Marvell PXA1908 SoC Karel Balej
@ 2025-12-24 19:14   ` Duje Mihanović
  2025-12-29 11:49   ` Ulf Hansson
  1 sibling, 0 replies; 4+ messages in thread
From: Duje Mihanović @ 2025-12-24 19:14 UTC (permalink / raw)
  To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	linux-arm-kernel, linux-pm, linux-kernel, devicetree, Karel Balej
  Cc: ~postmarketos/upstreaming, phone-devel, Karel Balej

On Saturday, 13 December 2025 09:48:13 Central European Standard Time Karel 
Balej wrote:
> Define power domain which needs to be enabled in order for audio to work
> on the PXA1908-based samsung,coreprimevelte smartphone. In the
> downstream code, this power-on method is marked as specific to the ULCx
> series which is allegedly a codename of sorts with ULC1 corresponding to
> the PXA1908.
> 
> No other audio components needed for sound to work on this phone are
> currently available mainline but some successful testing was performed
> with the vendor variants of the respective drivers and with the domain
> forced always-on.
> 
> Signed-off-by: Karel Balej <balejk@matfyz.cz>

Reviewed-by: Duje Mihanović <duje@dujemihanovic.xyz>

Regards,
--
Duje




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 2/2] pmdomain: add audio power island for Marvell PXA1908 SoC
  2025-12-13  8:48 ` [PATCH v2 2/2] pmdomain: add audio power island for Marvell PXA1908 SoC Karel Balej
  2025-12-24 19:14   ` Duje Mihanović
@ 2025-12-29 11:49   ` Ulf Hansson
  1 sibling, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2025-12-29 11:49 UTC (permalink / raw)
  To: Karel Balej
  Cc: Duje Mihanović, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-arm-kernel, linux-pm, linux-kernel,
	devicetree, ~postmarketos/upstreaming, phone-devel

On Sat, 13 Dec 2025 at 09:49, Karel Balej <balejk@matfyz.cz> wrote:
>
> Define power domain which needs to be enabled in order for audio to work
> on the PXA1908-based samsung,coreprimevelte smartphone. In the
> downstream code, this power-on method is marked as specific to the ULCx
> series which is allegedly a codename of sorts with ULC1 corresponding to
> the PXA1908.
>
> No other audio components needed for sound to work on this phone are
> currently available mainline but some successful testing was performed
> with the vendor variants of the respective drivers and with the domain
> forced always-on.
>
> Signed-off-by: Karel Balej <balejk@matfyz.cz>

Both patches applied for next, thanks!

Kind regards
Uffe


> ---
>
> Notes:
>     v2:
>     - APMU_AUD_CLK -> APMU_AUDIO_CLK and group it with other register
>       definitions. (Duje)
>     - Move default function exit path inside the switch. (Duje)
>     - Modify the commit message with information provided by Duje (thanks!).
>
>  .../marvell/pxa1908-power-controller.c        | 39 +++++++++++++++++--
>  1 file changed, 35 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/pmdomain/marvell/pxa1908-power-controller.c b/drivers/pmdomain/marvell/pxa1908-power-controller.c
> index ff5e6e82d3f8..543e8d33ac0c 100644
> --- a/drivers/pmdomain/marvell/pxa1908-power-controller.c
> +++ b/drivers/pmdomain/marvell/pxa1908-power-controller.c
> @@ -24,12 +24,15 @@
>  #define APMU_DEBUG             0x88
>  #define DSI_PHY_DVM_MASK       BIT(31)
>
> +#define APMU_AUDIO_CLK         0x80
> +#define AUDIO_ULCX_ENABLE      0x0d
> +
>  #define POWER_ON_LATENCY_US    300
>  #define POWER_OFF_LATENCY_US   20
>  #define POWER_POLL_TIMEOUT_US  (25 * USEC_PER_MSEC)
>  #define POWER_POLL_SLEEP_US    6
>
> -#define NR_DOMAINS     5
> +#define NR_DOMAINS     6
>
>  #define to_pxa1908_pd(_genpd) container_of(_genpd, struct pxa1908_pd, genpd)
>
> @@ -59,9 +62,14 @@ static inline bool pxa1908_pd_is_on(struct pxa1908_pd *pd)
>  {
>         struct pxa1908_pd_ctrl *ctrl = pd->ctrl;
>
> -       return pd->data.id != PXA1908_POWER_DOMAIN_DSI
> -               ? regmap_test_bits(ctrl->base, APMU_PWR_STATUS_REG, pd->data.pwr_state)
> -               : regmap_test_bits(ctrl->base, APMU_DEBUG, DSI_PHY_DVM_MASK);
> +       switch (pd->data.id) {
> +       case PXA1908_POWER_DOMAIN_AUDIO:
> +               return regmap_test_bits(ctrl->base, APMU_AUDIO_CLK, AUDIO_ULCX_ENABLE);
> +       case PXA1908_POWER_DOMAIN_DSI:
> +               return regmap_test_bits(ctrl->base, APMU_DEBUG, DSI_PHY_DVM_MASK);
> +       default:
> +               return regmap_test_bits(ctrl->base, APMU_PWR_STATUS_REG, pd->data.pwr_state);
> +       }
>  }
>
>  static int pxa1908_pd_power_on(struct generic_pm_domain *genpd)
> @@ -123,6 +131,22 @@ static inline int pxa1908_dsi_power_off(struct generic_pm_domain *genpd)
>         return regmap_clear_bits(ctrl->base, APMU_DEBUG, DSI_PHY_DVM_MASK);
>  }
>
> +static inline int pxa1908_audio_power_on(struct generic_pm_domain *genpd)
> +{
> +       struct pxa1908_pd *pd = to_pxa1908_pd(genpd);
> +       struct pxa1908_pd_ctrl *ctrl = pd->ctrl;
> +
> +       return regmap_set_bits(ctrl->base, APMU_AUDIO_CLK, AUDIO_ULCX_ENABLE);
> +}
> +
> +static inline int pxa1908_audio_power_off(struct generic_pm_domain *genpd)
> +{
> +       struct pxa1908_pd *pd = to_pxa1908_pd(genpd);
> +       struct pxa1908_pd_ctrl *ctrl = pd->ctrl;
> +
> +       return regmap_clear_bits(ctrl->base, APMU_AUDIO_CLK, AUDIO_ULCX_ENABLE);
> +}
> +
>  #define DOMAIN(_id, _name, ctrl, mode, state) \
>         [_id] = { \
>                 .data = { \
> @@ -159,6 +183,13 @@ static struct pxa1908_pd domains[NR_DOMAINS] = {
>                         .keep_on = true,
>                 },
>         },
> +       [PXA1908_POWER_DOMAIN_AUDIO] = {
> +               .genpd = {
> +                       .name = "audio",
> +                       .power_on = pxa1908_audio_power_on,
> +                       .power_off = pxa1908_audio_power_off,
> +               },
> +       },
>  };
>
>  static void pxa1908_pd_remove(struct auxiliary_device *auxdev)
> --
> 2.51.2
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-12-29 11:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-13  8:48 [PATCH v2 1/2] dt-bindings: power: define ID for Marvell PXA1908 audio domain Karel Balej
2025-12-13  8:48 ` [PATCH v2 2/2] pmdomain: add audio power island for Marvell PXA1908 SoC Karel Balej
2025-12-24 19:14   ` Duje Mihanović
2025-12-29 11:49   ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).