Skip to contentSkip to conversation

platform/x86: int3472: Use actual clock frequency for DSM method

PATCH Superseded Hao Yao 5 participants 7 messages Dec 5, 2025 – Dec 8, 2025

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Hao Yao

author
#0 lore raw

PATCH 1/1 platform/x86: int3472: Use actual clock frequency for DSM method

The third argument (args[2]) to the _DSM method was hardcoded to 1, which corresponds to 19.2MHz. However, this argument should reflect the actual clock frequency from the sensor's ACPI data.

According to the DSM specification:
- 1 = 19.2MHz
- 3 = 24MHz

Read the frequency from clk->frequency and set the DSM argument accordingly, with 19.2MHz as the default for unsupported frequencies.

This ensures the sensor receives the correct clock frequency as specified in its ACPI configuration.

---
 .../x86/intel/int3472/clk_and_regulator.c     | 21 ++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)
drivers/platform/x86/intel/int3472/clk_and_regulator.c +20 -1
index 9e052b164a1a..0502876284ee 100644
@@ -19,23 +19,42 @@ static const guid_t img_clk_guid =
 	GUID_INIT(0x82c0d13a, 0x78c5, 0x4244,
 		  0x9b, 0xb1, 0xeb, 0x8b, 0x53, 0x9a, 0x8d, 0x11);
 
+/*
+ * The PCH clock frequency argument to the _DSM method:
+ * PCH_CLK_FREQ_19M = 19.2MHz (default)
+ * PCH_CLK_FREQ_24M = 24MHz
+ */
+#define PCH_CLK_FREQ_19M	1
+#define PCH_CLK_FREQ_24M	3
+
 static void skl_int3472_enable_clk(struct int3472_clock *clk, int enable)
 {
 	struct int3472_discrete_device *int3472 = to_int3472_device(clk);
 	union acpi_object args[3];
 	union acpi_object argv4;
+	u32 dsm_freq_arg;
 
 	if (clk->ena_gpio) {
 		gpiod_set_value_cansleep(clk->ena_gpio, enable);
 		return;
 	}
 
+	switch (clk->frequency) {
+	case 24000000:
+		dsm_freq_arg = PCH_CLK_FREQ_24M;
+		break;
+	case 19200000:
+	default:
+		dsm_freq_arg = PCH_CLK_FREQ_19M;
+		break;
+	}
+
 	args[0].integer.type = ACPI_TYPE_INTEGER;
 	args[0].integer.value = clk->imgclk_index;
 	args[1].integer.type = ACPI_TYPE_INTEGER;
 	args[1].integer.value = enable;
 	args[2].integer.type = ACPI_TYPE_INTEGER;
-	args[2].integer.value = 1;
+	args[2].integer.value = dsm_freq_arg;
 
 	argv4.type = ACPI_TYPE_PACKAGE;
 	argv4.package.count = 3;
Signature · 1 line
2.43.0
#1 lore raw

Hao,

Thanks for the patch.

Quoted 8 lines · Hao Yao

The third argument (args[2]) to the _DSM method was hardcoded to 1, which corresponds to 19.2MHz. However, this argument should reflect the actual clock frequency from the sensor's ACPI data.

According to the DSM specification:
- 1 = 19.2MHz
- 3 = 24MHz

What are the value 0 and 2? I think there are other frequencies.

Quoted 16 lines

Read the frequency from clk->frequency and set the DSM argument accordingly, with 19.2MHz as the default for unsupported frequencies.

This ensures the sensor receives the correct clock frequency as specified in its ACPI configuration.

---
 .../x86/intel/int3472/clk_and_regulator.c     | 21 ++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)
drivers/platform/x86/intel/int3472/clk_and_regulator.c +0 -0
index 9e052b164a1a..0502876284ee 100644

drivers/platform/x86/intel/int3472/clk_and_regulator.c static const guid_t img_clk_guid = · line 27

Quoted 9 lines
drivers/platform/x86/intel/int3472/clk_and_regulator.c +6 -0
@@ -19,23 +19,42 @@ static const guid_t img_clk_guid =
 	GUID_INIT(0x82c0d13a, 0x78c5, 0x4244,
 		  0x9b, 0xb1, 0xeb, 0x8b, 0x53, 0x9a, 0x8d, 0x11);
 
+/*
+ * The PCH clock frequency argument to the _DSM method:
+ * PCH_CLK_FREQ_19M = 19.2MHz (default)
+ * PCH_CLK_FREQ_24M = 24MHz
+ */
+#define PCH_CLK_FREQ_19M	1

I like 19P2MHZ.

Quoted 35 lines
drivers/platform/x86/intel/int3472/clk_and_regulator.c +14 -1
+#define PCH_CLK_FREQ_24M	3
+
 static void skl_int3472_enable_clk(struct int3472_clock *clk, int enable)
 {
 	struct int3472_discrete_device *int3472 = to_int3472_device(clk);
 	union acpi_object args[3];
 	union acpi_object argv4;
+	u32 dsm_freq_arg;
 
 	if (clk->ena_gpio) {
 		gpiod_set_value_cansleep(clk->ena_gpio, enable);
 		return;
 	}
 
+	switch (clk->frequency) {
+	case 24000000:
+		dsm_freq_arg = PCH_CLK_FREQ_24M;
+		break;
+	case 19200000:
+	default:
+		dsm_freq_arg = PCH_CLK_FREQ_19M;
+		break;
+	}
+
 	args[0].integer.type = ACPI_TYPE_INTEGER;
 	args[0].integer.value = clk->imgclk_index;
 	args[1].integer.type = ACPI_TYPE_INTEGER;
 	args[1].integer.value = enable;
 	args[2].integer.type = ACPI_TYPE_INTEGER;
-	args[2].integer.value = 1;
+	args[2].integer.value = dsm_freq_arg;
 
 	argv4.type = ACPI_TYPE_PACKAGE;
 	argv4.package.count = 3;
Signature · 2 lines
Best regards,
Bingbu Cao
maintainer
#2 lore raw
Quoted 3 lines · Bingbu Cao
Quoted 1 line

+#define PCH_CLK_FREQ_19M 1

I like 19P2MHZ.

How about simply PCH_CLK_FREQ_19M2?

Signature · 1 line
Sakari Ailus
Reviewed-by
#3 lore raw

Hi,

Quoted 6 lines · Sakari Ailus
Quoted 3 lines · Bingbu Cao
Quoted 1 line

+#define PCH_CLK_FREQ_19M 1

I like 19P2MHZ.

How about simply PCH_CLK_FREQ_19M2?

+1 for this, this is the standard way to write fractional MHz clocks.

With that fixed / so for v2:

Regards,

Hans

author
#4 lore raw

Hi Hans,

Quoted 4 lines · On 12/7/25 22:43, [email protected] wrote:

Hi,

Quoted 1 line · Sakari Ailus

On Fri, Dec 05, 2025 at 06:10:10PM +0800, Bingbu Cao wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

+#define PCH_CLK_FREQ_19M 1

I like 19P2MHZ.

How about simply PCH_CLK_FREQ_19M2?

+1 for this, this is the standard way to write fractional MHz clocks.

Thank you. Will fix here in v2 patch.

Best Regards,
Hao Yao

Quoted 10 lines

With that fixed / so for v2:

Regards,

Hans

author
#5 lore raw
In reply to Bingbu Cao

Hi Bingbu,

Quoted 9 lines · Bingbu Cao

Hao,

Thanks for the patch.

Quoted 4 lines · Hao Yao

The third argument (args[2]) to the _DSM method was hardcoded to 1, which corresponds to 19.2MHz. However, this argument should reflect the actual clock frequency from the sensor's ACPI data.

Quoted 6 lines
Quoted 4 lines

According to the DSM specification:
- 1 = 19.2MHz
- 3 = 24MHz

What are the value 0 and 2? I think there are other frequencies.

Seems 0 and 2 are reserved for future options, as I can't get the clock output by setting these values.

Best Regards,
Hao Yao

Quoted 65 lines
Quoted 17 lines

Read the frequency from clk->frequency and set the DSM argument accordingly, with 19.2MHz as the default for unsupported frequencies.

This ensures the sensor receives the correct clock frequency as specified in its ACPI configuration.

---
  .../x86/intel/int3472/clk_and_regulator.c     | 21 ++++++++++++++++++-
  1 file changed, 20 insertions(+), 1 deletion(-)
drivers/platform/x86/intel/int3472/clk_and_regulator.c +0 -0
index 9e052b164a1a..0502876284ee 100644

drivers/platform/x86/intel/int3472/clk_and_regulator.c static const guid_t img_clk_guid = · line 27

Quoted 9 lines
drivers/platform/x86/intel/int3472/clk_and_regulator.c +6 -0
@@ -19,23 +19,42 @@ static const guid_t img_clk_guid =
  	GUID_INIT(0x82c0d13a, 0x78c5, 0x4244,
  		  0x9b, 0xb1, 0xeb, 0x8b, 0x53, 0x9a, 0x8d, 0x11);
 
+/*
+ * The PCH clock frequency argument to the _DSM method:
+ * PCH_CLK_FREQ_19M = 19.2MHz (default)
+ * PCH_CLK_FREQ_24M = 24MHz
+ */
+#define PCH_CLK_FREQ_19M	1

I like 19P2MHZ.

Quoted 35 lines
drivers/platform/x86/intel/int3472/clk_and_regulator.c +14 -1
+#define PCH_CLK_FREQ_24M	3
+
  static void skl_int3472_enable_clk(struct int3472_clock *clk, int enable)
  {
  	struct int3472_discrete_device *int3472 = to_int3472_device(clk);
  	union acpi_object args[3];
  	union acpi_object argv4;
+	u32 dsm_freq_arg;
 
  	if (clk->ena_gpio) {
  		gpiod_set_value_cansleep(clk->ena_gpio, enable);
  		return;
  	}
 
+	switch (clk->frequency) {
+	case 24000000:
+		dsm_freq_arg = PCH_CLK_FREQ_24M;
+		break;
+	case 19200000:
+	default:
+		dsm_freq_arg = PCH_CLK_FREQ_19M;
+		break;
+	}
+
  	args[0].integer.type = ACPI_TYPE_INTEGER;
  	args[0].integer.value = clk->imgclk_index;
  	args[1].integer.type = ACPI_TYPE_INTEGER;
  	args[1].integer.value = enable;
  	args[2].integer.type = ACPI_TYPE_INTEGER;
-	args[2].integer.value = 1;
+	args[2].integer.value = dsm_freq_arg;
 
  	argv4.type = ACPI_TYPE_PACKAGE;
  	argv4.package.count = 3;
maintainer
#6 lore raw
Quoted 17 lines · Hao Yao

Hi Bingbu,

Quoted 14 lines · Bingbu Cao

Hao,

Thanks for the patch.

Quoted 8 lines · Hao Yao

The third argument (args[2]) to the _DSM method was hardcoded to 1, which corresponds to 19.2MHz. However, this argument should reflect the actual clock frequency from the sensor's ACPI data.

According to the DSM specification:
- 1 = 19.2MHz
- 3 = 24MHz

Quoted 4 lines
Quoted 1 line

What are the value 0 and 2? I think there are other frequencies.

Seems 0 and 2 are reserved for future options, as I can't get the clock output by setting these values.

Hi,

This looks like useful information to add into the changelog itself so if somebody later wonders this same thing, they can get the information easily.

--
i.

Quoted 67 lines

Best Regards,
Hao Yao

Quoted 63 lines
Quoted 18 lines

Read the frequency from clk->frequency and set the DSM argument accordingly, with 19.2MHz as the default for unsupported frequencies.

This ensures the sensor receives the correct clock frequency as specified in its ACPI configuration.

---
  .../x86/intel/int3472/clk_and_regulator.c     | 21 ++++++++++++++++++-
  1 file changed, 20 insertions(+), 1 deletion(-)
drivers/platform/x86/intel/int3472/clk_and_regulator.c +0 -0
index 9e052b164a1a..0502876284ee 100644

drivers/platform/x86/intel/int3472/clk_and_regulator.c static const guid_t img_clk_guid = · line 26

Quoted 8 lines
drivers/platform/x86/intel/int3472/clk_and_regulator.c +5 -0
@@ -19,23 +19,42 @@ static const guid_t img_clk_guid =
  	GUID_INIT(0x82c0d13a, 0x78c5, 0x4244,
  		  0x9b, 0xb1, 0xeb, 0x8b, 0x53, 0x9a, 0x8d, 0x11);
  +/*
+ * The PCH clock frequency argument to the _DSM method:
+ * PCH_CLK_FREQ_19M = 19.2MHz (default)
+ * PCH_CLK_FREQ_24M = 24MHz
+ */
+#define PCH_CLK_FREQ_19M	1

I like 19P2MHZ.

Quoted 33 lines
drivers/platform/x86/intel/int3472/clk_and_regulator.c +13 -1
+#define PCH_CLK_FREQ_24M	3
+
  static void skl_int3472_enable_clk(struct int3472_clock *clk, int
 enable)
  {
  	struct int3472_discrete_device *int3472 = to_int3472_device(clk);
  	union acpi_object args[3];
  	union acpi_object argv4;
+	u32 dsm_freq_arg;
    	if (clk->ena_gpio) {
  		gpiod_set_value_cansleep(clk->ena_gpio, enable);
  		return;
  	}
  +	switch (clk->frequency) {
+	case 24000000:
+		dsm_freq_arg = PCH_CLK_FREQ_24M;
+		break;
+	case 19200000:
+	default:
+		dsm_freq_arg = PCH_CLK_FREQ_19M;
+		break;
+	}
+
  	args[0].integer.type = ACPI_TYPE_INTEGER;
  	args[0].integer.value = clk->imgclk_index;
  	args[1].integer.type = ACPI_TYPE_INTEGER;
  	args[1].integer.value = enable;
  	args[2].integer.type = ACPI_TYPE_INTEGER;
-	args[2].integer.value = 1;
+	args[2].integer.value = dsm_freq_arg;
    	argv4.type = ACPI_TYPE_PACKAGE;
  	argv4.package.count = 3;