mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] iio: light: cm32181: Add support for CM32183
@ 2026-11-18 15:11 NanamiKite
  2026-11-18 15:18 ` Joshua Crofts
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: NanamiKite @ 2026-11-18 15:11 UTC (permalink / raw)
  To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko
  Cc: Hans de Goede, linux-iio, linux-kernel

On the H3C MegaBook 14, the ACPI CPLM3218:00 node declares a Capella
CM32183 ambient light sensor (CPM0 device ID 0x7db7 / 32183) at I2C
address 0x29. Reading CM32181_REG_ADDR_ID (0x07) returns 0xc383, with
chip ID 0x83 in the lower byte, causing cm32181_reg_init() to fail with
-ENODEV.

The CM32183 uses the same register layout and ACPI CPM0/CPM1 tables as
the CM32181 and CM32182. Add chip ID 0x83 to cm32181_reg_init().

Cc: stable@vger.kernel.org
Signed-off-by: NanamiKite <nanami@yosoro.hk>
---
 drivers/iio/light/cm32181.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iio/light/cm32181.c b/drivers/iio/light/cm32181.c
index b32a940..aaf1af3 100644
--- a/drivers/iio/light/cm32181.c
+++ b/drivers/iio/light/cm32181.c
@@ -200,6 +200,7 @@ static int cm32181_reg_init(struct cm32181_chip *cm32181)
 		break;
 	case 0x81: /* CM32181 */
 	case 0x82: /* CM32182, fully compat. with CM32181 */
+	case 0x83: /* CM32183, fully compat. with CM32181 */
 		cm32181->num_als_it = ARRAY_SIZE(cm32181_als_it_bits);
 		cm32181->als_it_bits = cm32181_als_it_bits;
 		cm32181->als_it_values = cm32181_als_it_values;
-- 
2.56.1


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

* Re: [PATCH] iio: light: cm32181: Add support for CM32183
  2026-11-18 15:11 [PATCH] iio: light: cm32181: Add support for CM32183 NanamiKite
@ 2026-11-18 15:18 ` Joshua Crofts
  2026-11-18 15:42 ` Hans de Goede
  2026-11-19  1:44 ` Jonathan Cameron
  2 siblings, 0 replies; 6+ messages in thread
From: Joshua Crofts @ 2026-11-18 15:18 UTC (permalink / raw)
  To: NanamiKite
  Cc: Jonathan Cameron, David Lechner, Nuno Sá,
	Andy Shevchenko, Hans de Goede, linux-iio, linux-kernel

On Wed, 18 Nov 2026 23:11:00 +0800
NanamiKite <nanami@yosoro.hk> wrote:

> On the H3C MegaBook 14, the ACPI CPLM3218:00 node declares a Capella
> CM32183 ambient light sensor (CPM0 device ID 0x7db7 / 32183) at I2C
> address 0x29. Reading CM32181_REG_ADDR_ID (0x07) returns 0xc383, with
> chip ID 0x83 in the lower byte, causing cm32181_reg_init() to fail with
> -ENODEV.
> 
> The CM32183 uses the same register layout and ACPI CPM0/CPM1 tables as
> the CM32181 and CM32182. Add chip ID 0x83 to cm32181_reg_init().
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: NanamiKite <nanami@yosoro.hk>
> ---

LGTM.

Reviewed-by: Joshua Crofts <crofts@kernel.org>

-- 
Kind regards,
Joshua Crofts

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

* Re: [PATCH] iio: light: cm32181: Add support for CM32183
  2026-11-18 15:11 [PATCH] iio: light: cm32181: Add support for CM32183 NanamiKite
  2026-11-18 15:18 ` Joshua Crofts
@ 2026-11-18 15:42 ` Hans de Goede
  2026-11-19  1:44 ` Jonathan Cameron
  2 siblings, 0 replies; 6+ messages in thread
From: Hans de Goede @ 2026-11-18 15:42 UTC (permalink / raw)
  To: NanamiKite, Jonathan Cameron, David Lechner, Nuno Sá,
	Andy Shevchenko
  Cc: linux-iio, linux-kernel

Hi,

On 18-Nov-26 16:11, NanamiKite wrote:
> On the H3C MegaBook 14, the ACPI CPLM3218:00 node declares a Capella
> CM32183 ambient light sensor (CPM0 device ID 0x7db7 / 32183) at I2C
> address 0x29. Reading CM32181_REG_ADDR_ID (0x07) returns 0xc383, with
> chip ID 0x83 in the lower byte, causing cm32181_reg_init() to fail with
> -ENODEV.
> 
> The CM32183 uses the same register layout and ACPI CPM0/CPM1 tables as
> the CM32181 and CM32182. Add chip ID 0x83 to cm32181_reg_init().
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: NanamiKite <nanami@yosoro.hk>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com>

Regards,

Hans



> ---
>  drivers/iio/light/cm32181.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/iio/light/cm32181.c b/drivers/iio/light/cm32181.c
> index b32a940..aaf1af3 100644
> --- a/drivers/iio/light/cm32181.c
> +++ b/drivers/iio/light/cm32181.c
> @@ -200,6 +200,7 @@ static int cm32181_reg_init(struct cm32181_chip *cm32181)
>  		break;
>  	case 0x81: /* CM32181 */
>  	case 0x82: /* CM32182, fully compat. with CM32181 */
> +	case 0x83: /* CM32183, fully compat. with CM32181 */
>  		cm32181->num_als_it = ARRAY_SIZE(cm32181_als_it_bits);
>  		cm32181->als_it_bits = cm32181_als_it_bits;
>  		cm32181->als_it_values = cm32181_als_it_values;


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

* Re: [PATCH] iio: light: cm32181: Add support for CM32183
  2026-11-18 15:11 [PATCH] iio: light: cm32181: Add support for CM32183 NanamiKite
  2026-11-18 15:18 ` Joshua Crofts
  2026-11-18 15:42 ` Hans de Goede
@ 2026-11-19  1:44 ` Jonathan Cameron
  2026-11-19  2:33   ` NanamiKite
  2 siblings, 1 reply; 6+ messages in thread
From: Jonathan Cameron @ 2026-11-19  1:44 UTC (permalink / raw)
  To: NanamiKite
  Cc: David Lechner, Nuno Sá,
	Andy Shevchenko, Hans de Goede, linux-iio, linux-kernel

On Wed, 18 Nov 2026 23:11:00 +0800
NanamiKite <nanami@yosoro.hk> wrote:

> On the H3C MegaBook 14, the ACPI CPLM3218:00 node declares a Capella
> CM32183 ambient light sensor (CPM0 device ID 0x7db7 / 32183) at I2C
> address 0x29. Reading CM32181_REG_ADDR_ID (0x07) returns 0xc383, with
> chip ID 0x83 in the lower byte, causing cm32181_reg_init() to fail with
> -ENODEV.
> 
> The CM32183 uses the same register layout and ACPI CPM0/CPM1 tables as
> the CM32181 and CM32182. Add chip ID 0x83 to cm32181_reg_init().
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: NanamiKite <nanami@yosoro.hk>
Take a look at linux-next or the iio.git tree on kernel.org.
Or indeed sanity check the list.
https://lore.kernel.org/all/tencent_850445458D21608E9C8821E6728457F31C0A@qq.com/

Pretty unlucky to hit same thing that was added about 2 weeks ago.
I guess that device is proving popular!

> ---
>  drivers/iio/light/cm32181.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/iio/light/cm32181.c b/drivers/iio/light/cm32181.c
> index b32a940..aaf1af3 100644
> --- a/drivers/iio/light/cm32181.c
> +++ b/drivers/iio/light/cm32181.c
> @@ -200,6 +200,7 @@ static int cm32181_reg_init(struct cm32181_chip *cm32181)
>  		break;
>  	case 0x81: /* CM32181 */
>  	case 0x82: /* CM32182, fully compat. with CM32181 */
> +	case 0x83: /* CM32183, fully compat. with CM32181 */
>  		cm32181->num_als_it = ARRAY_SIZE(cm32181_als_it_bits);
>  		cm32181->als_it_bits = cm32181_als_it_bits;
>  		cm32181->als_it_values = cm32181_als_it_values;


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

* Re: [PATCH] iio: light: cm32181: Add support for CM32183
  2026-11-19  1:44 ` Jonathan Cameron
@ 2026-11-19  2:33   ` NanamiKite
  2026-11-19  9:06     ` Andy Shevchenko
  0 siblings, 1 reply; 6+ messages in thread
From: NanamiKite @ 2026-11-19  2:33 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: David Lechner, Nuno Sá,
	Andy Shevchenko, Hans de Goede, linux-iio, linux-kernel

On Thu, 19 Nov 2026 01:44:05 +0000
Jonathan Cameron <jic23@kernel.org> wrote:

> Take a look at linux-next or the iio.git tree on kernel.org. Or indeed sanity check the list.
> https://lore.kernel.org/all/tencent_850445458D21608E9C8821E6728457F31C0A@qq.com/
> Pretty unlucky to hit same thing that was added about 2 weeks ago. I guess that device is proving popular!

Thanks for the pointer, and sorry for the noise! I'll make sure to check
iio.git / linux-next first next time.

Haha, it's actually quite a niche device -- I just picked one up
secondhand to replace my old Surface Go 2 for development work, so I
definitely didn't expect someone else to have already sent the exact
same patch two weeks ago!

Best regards,
NanamiKite


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

* Re: [PATCH] iio: light: cm32181: Add support for CM32183
  2026-11-19  2:33   ` NanamiKite
@ 2026-11-19  9:06     ` Andy Shevchenko
  0 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2026-11-19  9:06 UTC (permalink / raw)
  To: NanamiKite
  Cc: Jonathan Cameron, David Lechner, Nuno Sá,
	Andy Shevchenko, Hans de Goede, linux-iio, linux-kernel

On Thu, Nov 19, 2026 at 10:33:00AM +0800, NanamiKite wrote:
> On Thu, 19 Nov 2026 01:44:05 +0000
> Jonathan Cameron <jic23@kernel.org> wrote:
> 
> > Take a look at linux-next or the iio.git tree on kernel.org. Or indeed sanity check the list.
> > https://lore.kernel.org/all/tencent_850445458D21608E9C8821E6728457F31C0A@qq.com/
> > Pretty unlucky to hit same thing that was added about 2 weeks ago. I guess that device is proving popular!
> 
> Thanks for the pointer, and sorry for the noise! I'll make sure to check
> iio.git / linux-next first next time.
> 
> Haha, it's actually quite a niche device -- I just picked one up
> secondhand to replace my old Surface Go 2 for development work, so I
> definitely didn't expect someone else to have already sent the exact
> same patch two weeks ago!

Linux on Microsoft Surface devices has a mature and active community.
Even I used to have Microsoft Surface Book 1 at some point... :-)

-- 
With Best Regards,
Andy Shevchenko



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

end of thread, other threads:[~2026-11-19  9:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-18 15:11 [PATCH] iio: light: cm32181: Add support for CM32183 NanamiKite
2026-11-18 15:18 ` Joshua Crofts
2026-11-18 15:42 ` Hans de Goede
2026-11-19  1:44 ` Jonathan Cameron
2026-11-19  2:33   ` NanamiKite
2026-11-19  9:06     ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®