Linux I2C development
 help / color / mirror / Atom feed
* [PATCH v2 0/2] i2c: Add ACPI support for HJMC01
@ 2024-09-26  2:40 hunter.yu
  2024-09-26  2:40 ` [PATCH v2 1/2] ACPI: APD: Add clock frequency for HJMC01 I2C controller hunter.yu
                   ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: hunter.yu @ 2024-09-26  2:40 UTC (permalink / raw)
  To: andriy.shevchenko, jarkko.nikula, lenb, rafael, jsd, andi.shyti
  Cc: linux-acpi, linux-i2c, andy.xu, peter.du, hunter.yu

Hi, everyone:

HJMC01 is an ARM-based server processor that contain a
Designware I2C controller. This series add ACPI support
for the Designware i2c controller.

v1->v2:
Adjust the order of ACPI HID according to the alphabetical order

hunter.yu (2):
  ACPI: APD: Add clock frequency for HJMC01 I2C controller
  i2c: designware: Add a new ACPI HID for HJMC01 I2C controller

 drivers/acpi/acpi_apd.c                     | 6 ++++++
 drivers/i2c/busses/i2c-designware-platdrv.c | 1 +
 2 files changed, 7 insertions(+)

-- 
2.43.5


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

* [PATCH v2 1/2] ACPI: APD: Add clock frequency for HJMC01 I2C controller
  2024-09-26  2:40 [PATCH v2 0/2] i2c: Add ACPI support for HJMC01 hunter.yu
@ 2024-09-26  2:40 ` hunter.yu
  2024-10-02 22:13   ` Andi Shyti
  2024-09-26  2:40 ` [PATCH v2 2/2] i2c: designware: Add a new ACPI HID " hunter.yu
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 22+ messages in thread
From: hunter.yu @ 2024-09-26  2:40 UTC (permalink / raw)
  To: andriy.shevchenko, jarkko.nikula, lenb, rafael, jsd, andi.shyti
  Cc: linux-acpi, linux-i2c, andy.xu, peter.du, hunter.yu

I2C clock frequency for HJMC01 is 200M, define a new ACPI
HID for it.

Signed-off-by: hunter.yu <hunter.yu@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 800f97868448..229e80a19664 100644
--- a/drivers/acpi/acpi_apd.c
+++ b/drivers/acpi/acpi_apd.c
@@ -181,6 +181,11 @@ static const struct apd_device_desc hip08_spi_desc = {
 	.setup = acpi_apd_setup,
 	.fixed_clk_rate = 250000000,
 };
+
+static const struct apd_device_desc hjmc_i2c_desc = {
+	.setup = acpi_apd_setup,
+	.fixed_clk_rate = 200000000,
+};
 #endif /* CONFIG_ARM64 */
 
 #endif
@@ -251,6 +256,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) },
 	{ "NXP0001", APD_ADDR(nxp_i2c_desc) },
 #endif
 	{ }
-- 
2.43.5


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

* [PATCH v2 2/2] i2c: designware: Add a new ACPI HID for HJMC01 I2C controller
  2024-09-26  2:40 [PATCH v2 0/2] i2c: Add ACPI support for HJMC01 hunter.yu
  2024-09-26  2:40 ` [PATCH v2 1/2] ACPI: APD: Add clock frequency for HJMC01 I2C controller hunter.yu
@ 2024-09-26  2:40 ` hunter.yu
  2024-09-26  8:44   ` Jarkko Nikula
  2024-09-26 12:15 ` [PATCH v2 0/2] i2c: Add ACPI support for HJMC01 Andy Shevchenko
  2024-10-03 12:56 ` Andi Shyti
  3 siblings, 1 reply; 22+ messages in thread
From: hunter.yu @ 2024-09-26  2:40 UTC (permalink / raw)
  To: andriy.shevchenko, jarkko.nikula, lenb, rafael, jsd, andi.shyti
  Cc: linux-acpi, linux-i2c, andy.xu, peter.du, hunter.yu

Define a new ACPI HID for HJMC01

Signed-off-by: hunter.yu <hunter.yu@hj-micro.com>
---
 drivers/i2c/busses/i2c-designware-platdrv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 2d0c7348e491..701506e92380 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -354,6 +354,7 @@ static const struct acpi_device_id dw_i2c_acpi_match[] = {
 	{ "HISI02A1", 0 },
 	{ "HISI02A2", 0 },
 	{ "HISI02A3", 0 },
+	{ "HJMC3001", 0 },
 	{ "HYGO0010", ACCESS_INTR_MASK },
 	{ "INT33C2", 0 },
 	{ "INT33C3", 0 },
-- 
2.43.5


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

* Re: [PATCH v2 2/2] i2c: designware: Add a new ACPI HID for HJMC01 I2C controller
  2024-09-26  2:40 ` [PATCH v2 2/2] i2c: designware: Add a new ACPI HID " hunter.yu
@ 2024-09-26  8:44   ` Jarkko Nikula
  0 siblings, 0 replies; 22+ messages in thread
From: Jarkko Nikula @ 2024-09-26  8:44 UTC (permalink / raw)
  To: hunter.yu, andriy.shevchenko, lenb, rafael, jsd, andi.shyti
  Cc: linux-acpi, linux-i2c, andy.xu, peter.du

On 9/26/24 5:40 AM, hunter.yu wrote:
> Define a new ACPI HID for HJMC01
> 
> Signed-off-by: hunter.yu <hunter.yu@hj-micro.com>
> ---
>   drivers/i2c/busses/i2c-designware-platdrv.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
> index 2d0c7348e491..701506e92380 100644
> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> @@ -354,6 +354,7 @@ static const struct acpi_device_id dw_i2c_acpi_match[] = {
>   	{ "HISI02A1", 0 },
>   	{ "HISI02A2", 0 },
>   	{ "HISI02A3", 0 },
> +	{ "HJMC3001", 0 },
>   	{ "HYGO0010", ACCESS_INTR_MASK },
>   	{ "INT33C2", 0 },
>   	{ "INT33C3", 0 },

Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>

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

* Re: [PATCH v2 0/2] i2c: Add ACPI support for HJMC01
  2024-09-26  2:40 [PATCH v2 0/2] i2c: Add ACPI support for HJMC01 hunter.yu
  2024-09-26  2:40 ` [PATCH v2 1/2] ACPI: APD: Add clock frequency for HJMC01 I2C controller hunter.yu
  2024-09-26  2:40 ` [PATCH v2 2/2] i2c: designware: Add a new ACPI HID " hunter.yu
@ 2024-09-26 12:15 ` Andy Shevchenko
  2024-10-03 12:56 ` Andi Shyti
  3 siblings, 0 replies; 22+ messages in thread
From: Andy Shevchenko @ 2024-09-26 12:15 UTC (permalink / raw)
  To: hunter.yu
  Cc: jarkko.nikula, lenb, rafael, jsd, andi.shyti, linux-acpi,
	linux-i2c, andy.xu, peter.du

On Thu, Sep 26, 2024 at 10:40:04AM +0800, hunter.yu wrote:
> Hi, everyone:
> 
> HJMC01 is an ARM-based server processor that contain a
> Designware I2C controller. This series add ACPI support
> for the Designware i2c controller.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v2 1/2] ACPI: APD: Add clock frequency for HJMC01 I2C controller
  2024-09-26  2:40 ` [PATCH v2 1/2] ACPI: APD: Add clock frequency for HJMC01 I2C controller hunter.yu
@ 2024-10-02 22:13   ` Andi Shyti
  2024-10-16 20:45     ` Rafael J. Wysocki
  0 siblings, 1 reply; 22+ messages in thread
From: Andi Shyti @ 2024-10-02 22:13 UTC (permalink / raw)
  To: hunter.yu
  Cc: andriy.shevchenko, jarkko.nikula, lenb, rafael, jsd, linux-acpi,
	linux-i2c, andy.xu, peter.du

On Thu, Sep 26, 2024 at 10:40:05AM GMT, hunter.yu wrote:
> I2C clock frequency for HJMC01 is 200M, define a new ACPI
> HID for it.
> 
> Signed-off-by: hunter.yu <hunter.yu@hj-micro.com>

Do you want your name to be hunter.yu or Hunter Yu? I prefer the
second and if you browse the git log, you can see that everyone
uses Name Surnmae.

Andi

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

* Re: [PATCH v2 0/2] i2c: Add ACPI support for HJMC01
  2024-09-26  2:40 [PATCH v2 0/2] i2c: Add ACPI support for HJMC01 hunter.yu
                   ` (2 preceding siblings ...)
  2024-09-26 12:15 ` [PATCH v2 0/2] i2c: Add ACPI support for HJMC01 Andy Shevchenko
@ 2024-10-03 12:56 ` Andi Shyti
  2024-11-18 15:54   ` Andi Shyti
  3 siblings, 1 reply; 22+ messages in thread
From: Andi Shyti @ 2024-10-03 12:56 UTC (permalink / raw)
  To: hunter.yu
  Cc: andriy.shevchenko, jarkko.nikula, lenb, rafael, jsd, linux-acpi,
	linux-i2c, andy.xu, peter.du

Hi Hunter,

> hunter.yu (2):
>   ACPI: APD: Add clock frequency for HJMC01 I2C controller
>   i2c: designware: Add a new ACPI HID for HJMC01 I2C controller

Applied to i2c/i2c-host and I took the freedom to change
"hunter.yu" with "Hunter Yu".

Thanks,
Andi

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

* Re: [PATCH v2 1/2] ACPI: APD: Add clock frequency for HJMC01 I2C controller
  2024-10-02 22:13   ` Andi Shyti
@ 2024-10-16 20:45     ` Rafael J. Wysocki
  2024-10-17  9:26       ` Andy Shevchenko
  2024-10-18  2:02       ` Hunter Yu
  0 siblings, 2 replies; 22+ messages in thread
From: Rafael J. Wysocki @ 2024-10-16 20:45 UTC (permalink / raw)
  To: Andi Shyti, hunter.yu
  Cc: andriy.shevchenko, jarkko.nikula, lenb, rafael, jsd, linux-acpi,
	linux-i2c, andy.xu, peter.du

On Thu, Oct 3, 2024 at 12:13 AM Andi Shyti <andi.shyti@kernel.org> wrote:
>
> On Thu, Sep 26, 2024 at 10:40:05AM GMT, hunter.yu wrote:
> > I2C clock frequency for HJMC01 is 200M, define a new ACPI
> > HID for it.
> >
> > Signed-off-by: hunter.yu <hunter.yu@hj-micro.com>
>
> Do you want your name to be hunter.yu or Hunter Yu? I prefer the
> second and if you browse the git log, you can see that everyone
> uses Name Surname.

It must be a real name as per submitting-patches.rst

The S-o-b is meaningless otherwise.

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

* Re: [PATCH v2 1/2] ACPI: APD: Add clock frequency for HJMC01 I2C controller
  2024-10-16 20:45     ` Rafael J. Wysocki
@ 2024-10-17  9:26       ` Andy Shevchenko
  2024-10-17  9:28         ` Andy Shevchenko
  2024-10-18  2:02       ` Hunter Yu
  1 sibling, 1 reply; 22+ messages in thread
From: Andy Shevchenko @ 2024-10-17  9:26 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Andi Shyti, hunter.yu, jarkko.nikula, lenb, jsd, linux-acpi,
	linux-i2c, andy.xu, peter.du

On Wed, Oct 16, 2024 at 10:45:26PM +0200, Rafael J. Wysocki wrote:
> On Thu, Oct 3, 2024 at 12:13 AM Andi Shyti <andi.shyti@kernel.org> wrote:
> > On Thu, Sep 26, 2024 at 10:40:05AM GMT, hunter.yu wrote:
> > > I2C clock frequency for HJMC01 is 200M, define a new ACPI
> > > HID for it.
> > >
> > > Signed-off-by: hunter.yu <hunter.yu@hj-micro.com>
> >
> > Do you want your name to be hunter.yu or Hunter Yu? I prefer the
> > second and if you browse the git log, you can see that everyone
> > uses Name Surname.
> 
> It must be a real name as per submitting-patches.rst

Hasn't this been relaxed last year by the d4563201f33a ("Documentation:
simplify and clarify DCO contribution example language")?

> The S-o-b is meaningless otherwise.

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v2 1/2] ACPI: APD: Add clock frequency for HJMC01 I2C controller
  2024-10-17  9:26       ` Andy Shevchenko
@ 2024-10-17  9:28         ` Andy Shevchenko
  2024-10-17 10:46           ` Rafael J. Wysocki
  0 siblings, 1 reply; 22+ messages in thread
From: Andy Shevchenko @ 2024-10-17  9:28 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Andi Shyti, hunter.yu, jarkko.nikula, lenb, jsd, linux-acpi,
	linux-i2c, andy.xu, peter.du

On Thu, Oct 17, 2024 at 12:26:18PM +0300, Andy Shevchenko wrote:
> On Wed, Oct 16, 2024 at 10:45:26PM +0200, Rafael J. Wysocki wrote:
> > On Thu, Oct 3, 2024 at 12:13 AM Andi Shyti <andi.shyti@kernel.org> wrote:
> > > On Thu, Sep 26, 2024 at 10:40:05AM GMT, hunter.yu wrote:
> > > > I2C clock frequency for HJMC01 is 200M, define a new ACPI
> > > > HID for it.
> > > >
> > > > Signed-off-by: hunter.yu <hunter.yu@hj-micro.com>
> > >
> > > Do you want your name to be hunter.yu or Hunter Yu? I prefer the
> > > second and if you browse the git log, you can see that everyone
> > > uses Name Surname.
> > 
> > It must be a real name as per submitting-patches.rst
> 
> Hasn't this been relaxed last year by the d4563201f33a ("Documentation:
> simplify and clarify DCO contribution example language")?

Note, I do not imply that the existing variant in this patch is ideal, I also,
as Andi, prefer the proper spellings on the "name" parts.

> > The S-o-b is meaningless otherwise.

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v2 1/2] ACPI: APD: Add clock frequency for HJMC01 I2C controller
  2024-10-17  9:28         ` Andy Shevchenko
@ 2024-10-17 10:46           ` Rafael J. Wysocki
  0 siblings, 0 replies; 22+ messages in thread
From: Rafael J. Wysocki @ 2024-10-17 10:46 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Rafael J. Wysocki, Andi Shyti, hunter.yu, jarkko.nikula, lenb,
	jsd, linux-acpi, linux-i2c, andy.xu, peter.du

On Thu, Oct 17, 2024 at 11:29 AM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Thu, Oct 17, 2024 at 12:26:18PM +0300, Andy Shevchenko wrote:
> > On Wed, Oct 16, 2024 at 10:45:26PM +0200, Rafael J. Wysocki wrote:
> > > On Thu, Oct 3, 2024 at 12:13 AM Andi Shyti <andi.shyti@kernel.org> wrote:
> > > > On Thu, Sep 26, 2024 at 10:40:05AM GMT, hunter.yu wrote:
> > > > > I2C clock frequency for HJMC01 is 200M, define a new ACPI
> > > > > HID for it.
> > > > >
> > > > > Signed-off-by: hunter.yu <hunter.yu@hj-micro.com>
> > > >
> > > > Do you want your name to be hunter.yu or Hunter Yu? I prefer the
> > > > second and if you browse the git log, you can see that everyone
> > > > uses Name Surname.
> > >
> > > It must be a real name as per submitting-patches.rst
> >
> > Hasn't this been relaxed last year by the d4563201f33a ("Documentation:
> > simplify and clarify DCO contribution example language")?
>
> Note, I do not imply that the existing variant in this patch is ideal, I also,
> as Andi, prefer the proper spellings on the "name" parts.

Good.

Now, the way I understand the "known identity" part of the document is
that a misspelled name is not sufficient.

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

* Re: [PATCH v2 1/2] ACPI: APD: Add clock frequency for HJMC01 I2C controller
  2024-10-16 20:45     ` Rafael J. Wysocki
  2024-10-17  9:26       ` Andy Shevchenko
@ 2024-10-18  2:02       ` Hunter Yu
  1 sibling, 0 replies; 22+ messages in thread
From: Hunter Yu @ 2024-10-18  2:02 UTC (permalink / raw)
  To: Rafael J. Wysocki, Andi Shyti
  Cc: andriy.shevchenko, jarkko.nikula, lenb, jsd, linux-acpi,
	linux-i2c, andy.xu, peter.du

On 2024/10/17 4:45, Rafael J. Wysocki wrote:
> On Thu, Oct 3, 2024 at 12:13 AM Andi Shyti <andi.shyti@kernel.org> wrote:
>>
>> On Thu, Sep 26, 2024 at 10:40:05AM GMT, hunter.yu wrote:
>>> I2C clock frequency for HJMC01 is 200M, define a new ACPI
>>> HID for it.
>>>
>>> Signed-off-by: hunter.yu <hunter.yu@hj-micro.com>
>>
>> Do you want your name to be hunter.yu or Hunter Yu? I prefer the
>> second and if you browse the git log, you can see that everyone
>> uses Name Surname.
> 
> It must be a real name as per submitting-patches.rst
> 
> The S-o-b is meaningless otherwise.
> 

Thanks for your help and advice. In our team, everyone have an alias 
name, which is the same as email address. I feel sorry for not noticing 
kernel community's requirement for real name.
My real name is Xiangyang Yu, I will use the following format to send v3 
patch later.

Signed-off-by: Xiangyang Yu <hunter.yu@hj-micro.com>

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

* Re: [PATCH v2 0/2] i2c: Add ACPI support for HJMC01
  2024-10-03 12:56 ` Andi Shyti
@ 2024-11-18 15:54   ` Andi Shyti
  2026-07-22  7:30     ` [PATCH v3] ACPI: APD: Add clock frequency for HJMC01 I2C controller clarke.li
  0 siblings, 1 reply; 22+ messages in thread
From: Andi Shyti @ 2024-11-18 15:54 UTC (permalink / raw)
  To: hunter.yu, Rafael J. Wysocki
  Cc: andriy.shevchenko, jarkko.nikula, lenb, rafael, jsd, linux-acpi,
	linux-i2c, andy.xu, peter.du

Hi,

On Thu, Oct 03, 2024 at 02:56:51PM +0200, Andi Shyti wrote:
> > hunter.yu (2):
> >   ACPI: APD: Add clock frequency for HJMC01 I2C controller
> >   i2c: designware: Add a new ACPI HID for HJMC01 I2C controller
> 
> Applied to i2c/i2c-host and I took the freedom to change
> "hunter.yu" with "Hunter Yu".

I'm sorry, I mistakenly included this patch in my branch and
removed it from the pull request.

Apologies, Rafael, for stepping on your toes. Passing the ball
to you now.

Andi

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

* [PATCH v3] ACPI: APD: Add clock frequency for HJMC01 I2C controller
  2024-11-18 15:54   ` Andi Shyti
@ 2026-07-22  7:30     ` clarke.li
  2026-08-06 20:31       ` Andy Shevchenko
  2026-08-13  6:30       ` [PATCH v4 1/2] ACPI: APD: Convert fixed clock rates to use HZ_PER_MHZ clarke.li
  0 siblings, 2 replies; 22+ messages in thread
From: clarke.li @ 2026-07-22  7:30 UTC (permalink / raw)
  To: andi.shyti, andriy.shevchenko, rafael, jarkko.nikula, jsd, lenb
  Cc: andy.xu, linux-acpi, linux-i2c, peter.du, clarke.li

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 008bd0552cb7..a193d8a6538e 100644
--- a/drivers/acpi/acpi_apd.c
+++ b/drivers/acpi/acpi_apd.c
@@ -192,6 +192,11 @@ static const struct apd_device_desc leca_i2c_desc = {
 	.fixed_clk_rate = 250000000,
 };

+static const struct apd_device_desc hjmc_i2c_desc = {
+	.setup = acpi_apd_setup,
+	.fixed_clk_rate = 200000000,
+};
+
 #endif /* CONFIG_ARM64 */

 #endif
@@ -264,6 +269,7 @@ static const struct acpi_device_id acpi_apd_device_ids[] = {
 	{ "HISI0173", APD_ADDR(hip08_spi_desc) },
 	{ "LECA0002", APD_ADDR(leca_spi_desc) },
 	{ "LECA0003", APD_ADDR(leca_i2c_desc) },
+	{ "HJMC3001", APD_ADDR(hjmc_i2c_desc) },
 	{ "NXP0001", APD_ADDR(nxp_i2c_desc) },
 #endif
 	{ }
--
2.55.0


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

* Re: [PATCH v3] ACPI: APD: Add clock frequency for HJMC01 I2C controller
  2026-07-22  7:30     ` [PATCH v3] ACPI: APD: Add clock frequency for HJMC01 I2C controller clarke.li
@ 2026-08-06 20:31       ` Andy Shevchenko
  2026-08-11  6:22         ` clarke.li
  2026-08-13  6:30       ` [PATCH v4 1/2] ACPI: APD: Convert fixed clock rates to use HZ_PER_MHZ clarke.li
  1 sibling, 1 reply; 22+ messages in thread
From: Andy Shevchenko @ 2026-08-06 20:31 UTC (permalink / raw)
  To: clarke.li
  Cc: andi.shyti, rafael, jarkko.nikula, jsd, lenb, andy.xu, linux-acpi,
	linux-i2c, peter.du

On Wed, Jul 22, 2026 at 03:30:31PM +0800, clarke.li wrote:

> I2C clock frequency for HJMC01 is 200MHz, define a new ACPI
> HID for it.

...

> +	.fixed_clk_rate = 200000000,

Can you at some point update these constants to use

	.fixed_clk_rate = 200 * HZ_PER_MHZ,

and so on?

...

>  	{ "HISI0173", APD_ADDR(hip08_spi_desc) },
>  	{ "LECA0002", APD_ADDR(leca_spi_desc) },
>  	{ "LECA0003", APD_ADDR(leca_i2c_desc) },
> +	{ "HJMC3001", APD_ADDR(hjmc_i2c_desc) },
>  	{ "NXP0001", APD_ADDR(nxp_i2c_desc) },

Keep it sorted.

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v3] ACPI: APD: Add clock frequency for HJMC01 I2C controller
  2026-08-06 20:31       ` Andy Shevchenko
@ 2026-08-11  6:22         ` clarke.li
  2026-08-11  6:54           ` Andy Shevchenko
  0 siblings, 1 reply; 22+ messages in thread
From: clarke.li @ 2026-08-11  6:22 UTC (permalink / raw)
  To: andriy.shevchenko
  Cc: andi.shyti, andy.xu, clarke.li, jarkko.nikula, jsd, lenb,
	linux-acpi, linux-i2c, peter.du, rafael

On Thu, Aug 06, 2026 at 11:31:01PM +0300, Andy Shevchenko wrote:

> On Wed, Jul 22, 2026 at 03:30:31PM +0800, clarke.li wrote:
>
> > I2C clock frequency for HJMC01 is 200MHz, define a new ACPI
> > HID for it.
>
> ...

> > +	.fixed_clk_rate = 200000000,
>
> Can you at some point update these constants to use
>
> 	.fixed_clk_rate = 200 * HZ_PER_MHZ,
>
> and so on?

Thanks for the suggestion, I will use 200 * HZ_PER_MHZ in the
next version.

By the way, do you also want me to convert the other
fixed_clk_rate constants in acpi_apd.c to use HZ_PER_MHZ?
If so, I can send it as a separate cleanup patch.

> ...
>
> >  	{ "HISI0173", APD_ADDR(hip08_spi_desc) },
> >  	{ "LECA0002", APD_ADDR(leca_spi_desc) },
> >  	{ "LECA0003", APD_ADDR(leca_i2c_desc) },
> > +	{ "HJMC3001", APD_ADDR(hjmc_i2c_desc) },
> >  	{ "NXP0001", APD_ADDR(nxp_i2c_desc) },
>
> Keep it sorted.

You are right, HJMC3001 should be placed before LECA0002
alphabetically. I will fix the order in the next version.

--
Thanks,
Hongnan Li

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

* Re: [PATCH v3] ACPI: APD: Add clock frequency for HJMC01 I2C controller
  2026-08-11  6:22         ` clarke.li
@ 2026-08-11  6:54           ` Andy Shevchenko
  2026-08-11  9:07             ` clarke.li
  0 siblings, 1 reply; 22+ messages in thread
From: Andy Shevchenko @ 2026-08-11  6:54 UTC (permalink / raw)
  To: clarke.li
  Cc: andi.shyti, andy.xu, jarkko.nikula, jsd, lenb, linux-acpi,
	linux-i2c, peter.du, rafael

On Tue, Aug 11, 2026 at 02:22:34PM +0800, clarke.li wrote:
> On Thu, Aug 06, 2026 at 11:31:01PM +0300, Andy Shevchenko wrote:
> > On Wed, Jul 22, 2026 at 03:30:31PM +0800, clarke.li wrote:

...

> > > +	.fixed_clk_rate = 200000000,
> >
> > Can you at some point update these constants to use
> >
> > 	.fixed_clk_rate = 200 * HZ_PER_MHZ,
> >
> > and so on?
> 
> Thanks for the suggestion, I will use 200 * HZ_PER_MHZ in the
> next version.
> 
> By the way, do you also want me to convert the other
> fixed_clk_rate constants in acpi_apd.c to use HZ_PER_MHZ?
> If so, I can send it as a separate cleanup patch.

The idea is that you convert existing ones in a separate patch and then use a
new format for the new hw support.

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v3] ACPI: APD: Add clock frequency for HJMC01 I2C controller
  2026-08-11  6:54           ` Andy Shevchenko
@ 2026-08-11  9:07             ` clarke.li
  0 siblings, 0 replies; 22+ messages in thread
From: clarke.li @ 2026-08-11  9:07 UTC (permalink / raw)
  To: andriy.shevchenko
  Cc: andi.shyti, andy.xu, clarke.li, jarkko.nikula, jsd, lenb,
	linux-acpi, linux-i2c, peter.du, rafael

On Tue, Aug 11, 2026 at 09:54:33AM +0300, Andy Shevchenko wrote:

> On Tue, Aug 11, 2026 at 02:22:34PM +0800, clarke.li wrote:
> > On Thu, Aug 06, 2026 at 11:31:01PM +0300, Andy Shevchenko wrote:
> > > On Wed, Jul 22, 2026 at 03:30:31PM +0800, clarke.li wrote:
>
> ...
>
> > > > +	.fixed_clk_rate = 200000000,
> > >
> > > Can you at some point update these constants to use
> > >
> > > 	.fixed_clk_rate = 200 * HZ_PER_MHZ,
> > >
> > > and so on?
> >
> > Thanks for the suggestion, I will use 200 * HZ_PER_MHZ in the
> > next version.
> >
> > By the way, do you also want me to convert the other
> > fixed_clk_rate constants in acpi_apd.c to use HZ_PER_MHZ?
> > If so, I can send it as a separate cleanup patch.
>
> The idea is that you convert existing ones in a separate patch and then use a
> new format for the new hw support.

Understood. I will send the next revision as a two-patch series:

  [PATCH v4 1/2] ACPI: APD: Convert fixed clock rates to HZ_PER_MHZ
  [PATCH v4 2/2] ACPI: APD: Add clock frequency for HJMC01 I2C controller

The first patch converts the existing fixed_clk_rate constants in
acpi_apd.c to use HZ_PER_MHZ, and the second one adds the HJMC01
support using the new format (200 * HZ_PER_MHZ).

--
Thanks,
Hongnan Li

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

* [PATCH v4 1/2] ACPI: APD: Convert fixed clock rates to use HZ_PER_MHZ
  2026-07-22  7:30     ` [PATCH v3] ACPI: APD: Add clock frequency for HJMC01 I2C controller clarke.li
  2026-08-06 20:31       ` Andy Shevchenko
@ 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
  1 sibling, 2 replies; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 22+ messages in thread

end of thread, other threads:[~2026-08-13  7:56 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-26  2:40 [PATCH v2 0/2] i2c: Add ACPI support for HJMC01 hunter.yu
2024-09-26  2:40 ` [PATCH v2 1/2] ACPI: APD: Add clock frequency for HJMC01 I2C controller hunter.yu
2024-10-02 22:13   ` Andi Shyti
2024-10-16 20:45     ` Rafael J. Wysocki
2024-10-17  9:26       ` Andy Shevchenko
2024-10-17  9:28         ` Andy Shevchenko
2024-10-17 10:46           ` Rafael J. Wysocki
2024-10-18  2:02       ` Hunter Yu
2024-09-26  2:40 ` [PATCH v2 2/2] i2c: designware: Add a new ACPI HID " hunter.yu
2024-09-26  8:44   ` Jarkko Nikula
2024-09-26 12:15 ` [PATCH v2 0/2] i2c: Add ACPI support for HJMC01 Andy Shevchenko
2024-10-03 12:56 ` Andi Shyti
2024-11-18 15:54   ` Andi Shyti
2026-07-22  7:30     ` [PATCH v3] ACPI: APD: Add clock frequency for HJMC01 I2C controller clarke.li
2026-08-06 20:31       ` Andy Shevchenko
2026-08-11  6:22         ` clarke.li
2026-08-11  6:54           ` Andy Shevchenko
2026-08-11  9:07             ` clarke.li
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