* [PATCH v4 1/2] ACPI: APD: Convert fixed clock rates to use HZ_PER_MHZ
[not found] <20260722073031.1078080-1-clarke.li@hj-micro.com>
@ 2026-08-13 6:30 ` clarke.li
2026-08-13 6:40 ` [PATCH v4 2/2] ACPI: APD: Add clock frequency for HJMC01 I2C controller clarke.li
2026-08-13 7:35 ` [PATCH v4 1/2] ACPI: APD: Convert fixed clock rates to use HZ_PER_MHZ Andy Shevchenko
0 siblings, 2 replies; 4+ messages in thread
From: clarke.li @ 2026-08-13 6:30 UTC (permalink / raw)
To: Rafael J . Wysocki, Andi Shyti
Cc: linux-acpi, linux-i2c, linux-kernel, Andy Shevchenko, Len Brown,
andy.xu, peter.du, Hongnan Li
From: Hongnan Li <clarke.li@hj-micro.com>
Use HZ_PER_MHZ multiplier for fixed_clk_rate values to
improve readability.
Signed-off-by: Hongnan Li <clarke.li@hj-micro.com>
---
drivers/acpi/acpi_apd.c | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c
index 008bd0552cb7..275027ebd01f 100644
--- a/drivers/acpi/acpi_apd.c
+++ b/drivers/acpi/acpi_apd.c
@@ -14,6 +14,7 @@
#include <linux/io.h>
#include <linux/platform_data/clk-fch.h>
#include <linux/platform_device.h>
+#include <linux/units.h>
#include "internal.h"
@@ -110,17 +111,17 @@ static int fch_misc_setup(struct apd_private_data *pdata)
static const struct apd_device_desc cz_i2c_desc = {
.setup = acpi_apd_setup,
- .fixed_clk_rate = 133000000,
+ .fixed_clk_rate = 133 * HZ_PER_MHZ,
};
static const struct apd_device_desc wt_i2c_desc = {
.setup = acpi_apd_setup,
- .fixed_clk_rate = 150000000,
+ .fixed_clk_rate = 150 * HZ_PER_MHZ,
};
static const struct apd_device_desc wt_i3c_desc = {
.setup = acpi_apd_setup,
- .fixed_clk_rate = 125000000,
+ .fixed_clk_rate = 125 * HZ_PER_MHZ,
};
static struct property_entry uart_properties[] = {
@@ -132,7 +133,7 @@ static struct property_entry uart_properties[] = {
static const struct apd_device_desc cz_uart_desc = {
.setup = acpi_apd_setup,
- .fixed_clk_rate = 48000000,
+ .fixed_clk_rate = 48 * HZ_PER_MHZ,
.properties = uart_properties,
};
@@ -144,52 +145,52 @@ static const struct apd_device_desc fch_misc_desc = {
#ifdef CONFIG_ARM64
static const struct apd_device_desc xgene_i2c_desc = {
.setup = acpi_apd_setup,
- .fixed_clk_rate = 100000000,
+ .fixed_clk_rate = 100 * HZ_PER_MHZ,
};
static const struct apd_device_desc vulcan_spi_desc = {
.setup = acpi_apd_setup,
- .fixed_clk_rate = 133000000,
+ .fixed_clk_rate = 133 * HZ_PER_MHZ,
};
static const struct apd_device_desc hip07_i2c_desc = {
.setup = acpi_apd_setup,
- .fixed_clk_rate = 200000000,
+ .fixed_clk_rate = 200 * HZ_PER_MHZ,
};
static const struct apd_device_desc hip08_i2c_desc = {
.setup = acpi_apd_setup,
- .fixed_clk_rate = 250000000,
+ .fixed_clk_rate = 250 * HZ_PER_MHZ,
};
static const struct apd_device_desc hip08_lite_i2c_desc = {
.setup = acpi_apd_setup,
- .fixed_clk_rate = 125000000,
+ .fixed_clk_rate = 125 * HZ_PER_MHZ,
};
static const struct apd_device_desc thunderx2_i2c_desc = {
.setup = acpi_apd_setup,
- .fixed_clk_rate = 125000000,
+ .fixed_clk_rate = 125 * HZ_PER_MHZ,
};
static const struct apd_device_desc nxp_i2c_desc = {
.setup = acpi_apd_setup,
- .fixed_clk_rate = 350000000,
+ .fixed_clk_rate = 350 * HZ_PER_MHZ,
};
static const struct apd_device_desc hip08_spi_desc = {
.setup = acpi_apd_setup,
- .fixed_clk_rate = 250000000,
+ .fixed_clk_rate = 250 * HZ_PER_MHZ,
};
static const struct apd_device_desc leca_spi_desc = {
.setup = acpi_apd_setup,
- .fixed_clk_rate = 400000000,
+ .fixed_clk_rate = 400 * HZ_PER_MHZ,
};
static const struct apd_device_desc leca_i2c_desc = {
.setup = acpi_apd_setup,
- .fixed_clk_rate = 250000000,
+ .fixed_clk_rate = 250 * HZ_PER_MHZ,
};
#endif /* CONFIG_ARM64 */
--
2.55.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v4 2/2] ACPI: APD: Add clock frequency for HJMC01 I2C controller
2026-08-13 6:30 ` [PATCH v4 1/2] ACPI: APD: Convert fixed clock rates to use HZ_PER_MHZ clarke.li
@ 2026-08-13 6:40 ` clarke.li
2026-08-13 7:46 ` Andy Shevchenko
2026-08-13 7:35 ` [PATCH v4 1/2] ACPI: APD: Convert fixed clock rates to use HZ_PER_MHZ Andy Shevchenko
1 sibling, 1 reply; 4+ messages in thread
From: clarke.li @ 2026-08-13 6:40 UTC (permalink / raw)
To: Rafael J . Wysocki, Andi Shyti
Cc: linux-acpi, linux-i2c, linux-kernel, Andy Shevchenko, Len Brown,
andy.xu, peter.du
From: Xiangyang Yu <hunter.yu@hj-micro.com>
I2C clock frequency for HJMC01 is 200MHz, define a new ACPI
HID for it.
Signed-off-by: Xiangyang Yu <hunter.yu@hj-micro.com>
Signed-off-by: Hongnan Li <clarke.li@hj-micro.com>
---
drivers/acpi/acpi_apd.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c
index 275027ebd01f..e7366fcb76ee 100644
--- a/drivers/acpi/acpi_apd.c
+++ b/drivers/acpi/acpi_apd.c
@@ -193,6 +193,11 @@ static const struct apd_device_desc leca_i2c_desc = {
.fixed_clk_rate = 250 * HZ_PER_MHZ,
};
+static const struct apd_device_desc hjmc_i2c_desc = {
+ .setup = acpi_apd_setup,
+ .fixed_clk_rate = 200 * HZ_PER_MHZ,
+};
+
#endif /* CONFIG_ARM64 */
#endif
@@ -263,6 +268,7 @@ static const struct acpi_device_id acpi_apd_device_ids[] = {
{ "HISI02A2", APD_ADDR(hip08_i2c_desc) },
{ "HISI02A3", APD_ADDR(hip08_lite_i2c_desc) },
{ "HISI0173", APD_ADDR(hip08_spi_desc) },
+ { "HJMC3001", APD_ADDR(hjmc_i2c_desc) },
{ "LECA0002", APD_ADDR(leca_spi_desc) },
{ "LECA0003", APD_ADDR(leca_i2c_desc) },
{ "NXP0001", APD_ADDR(nxp_i2c_desc) },
--
2.55.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v4 1/2] ACPI: APD: Convert fixed clock rates to use HZ_PER_MHZ
2026-08-13 6:30 ` [PATCH v4 1/2] ACPI: APD: Convert fixed clock rates to use HZ_PER_MHZ clarke.li
2026-08-13 6:40 ` [PATCH v4 2/2] ACPI: APD: Add clock frequency for HJMC01 I2C controller clarke.li
@ 2026-08-13 7:35 ` Andy Shevchenko
1 sibling, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2026-08-13 7:35 UTC (permalink / raw)
To: clarke.li
Cc: Rafael J . Wysocki, Andi Shyti, linux-acpi, linux-i2c,
linux-kernel, Len Brown, andy.xu, peter.du
On Thu, Aug 13, 2026 at 02:30:04PM +0800, clarke.li wrote:
> Use HZ_PER_MHZ multiplier for fixed_clk_rate values to
> improve readability.
And actually increases robustness of the code as there is less chances
to miss a 0 or have an extra one.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v4 2/2] ACPI: APD: Add clock frequency for HJMC01 I2C controller
2026-08-13 6:40 ` [PATCH v4 2/2] ACPI: APD: Add clock frequency for HJMC01 I2C controller clarke.li
@ 2026-08-13 7:46 ` Andy Shevchenko
0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2026-08-13 7:46 UTC (permalink / raw)
To: clarke.li
Cc: Rafael J . Wysocki, Andi Shyti, linux-acpi, linux-i2c,
linux-kernel, Len Brown, andy.xu, peter.du
On Thu, Aug 13, 2026 at 02:40:25PM +0800, clarke.li wrote:
> I2C clock frequency for HJMC01 is 200MHz, define a new ACPI
> HID for it.
LGTM now,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
...
> + { "HJMC3001", APD_ADDR(hjmc_i2c_desc) },
Vendor is in the official registry and ID is real, thanks for that!
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-08-13 7:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260722073031.1078080-1-clarke.li@hj-micro.com>
2026-08-13 6:30 ` [PATCH v4 1/2] ACPI: APD: Convert fixed clock rates to use HZ_PER_MHZ clarke.li
2026-08-13 6:40 ` [PATCH v4 2/2] ACPI: APD: Add clock frequency for HJMC01 I2C controller clarke.li
2026-08-13 7:46 ` Andy Shevchenko
2026-08-13 7:35 ` [PATCH v4 1/2] ACPI: APD: Convert fixed clock rates to use HZ_PER_MHZ Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox