devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 2/2] Added mhz19c to compatible list in mhz19b driver.
@ 2025-08-31  8:09 Sidharth Seela
  2025-08-31 15:36 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Sidharth Seela @ 2025-08-31  8:09 UTC (permalink / raw)
  To: Gyeyoung Baek
  Cc: jic23, dlechner, nuno.sa, andy, robh, krzk+dt, conor+dt,
	linux-iio, devicetree

The pin-compatiblity and UART configuration are same. Although
documentation on mhz19c's UART commands is sparse. It can be reasonably
thought of that the commands from mhz19b will be supported in mhz19c.
The mhz19b document mentions all the different commands. Still the
uncertainity is noted.

Signed-off-by: Sidharth Seela <sidharthseela@gmail.com>
---
 drivers/iio/chemical/mhz19b.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/iio/chemical/mhz19b.c b/drivers/iio/chemical/mhz19b.c
index 3c64154918b1..4899aad895d5 100644
--- a/drivers/iio/chemical/mhz19b.c
+++ b/drivers/iio/chemical/mhz19b.c
@@ -297,7 +297,17 @@ static int mhz19b_probe(struct serdev_device *serdev)
 }

 static const struct of_device_id mhz19b_of_match[] = {
+       /* It should be noted that mhz19b is discontinued*/
        { .compatible = "winsen,mhz19b", },
+       /* Beware that mhz19c has same pinout, UART characteristics.But there
+        * are gaps in the official user-manual[1], specifically
+        * regarding.
+        *              Calibrate Zero Point.
+        *              Calibrate Span Point.
+        *              Detection range setting.
+        * Ref [1]:
https://www.winsen-sensor.com/d/files/infrared-gas-sensor/mh-z19c-pins-type-co2-manual-ver1_0.pdf
+        */
+       { .compatible = "winsen,mhz19c", },
        { }
 };
 MODULE_DEVICE_TABLE(of, mhz19b_of_match);
--
2.39.5 (Apple Git-154)

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

* Re: [PATCH v1 2/2] Added mhz19c to compatible list in mhz19b driver.
  2025-08-31  8:09 [PATCH v1 2/2] Added mhz19c to compatible list in mhz19b driver Sidharth Seela
@ 2025-08-31 15:36 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2025-08-31 15:36 UTC (permalink / raw)
  To: Sidharth Seela
  Cc: Gyeyoung Baek, dlechner, nuno.sa, andy, robh, krzk+dt, conor+dt,
	linux-iio, devicetree

On Sun, 31 Aug 2025 13:54:20 +0545
Sidharth Seela <sidharthseela@gmail.com> wrote:

> The pin-compatiblity and UART configuration are same. Although
> documentation on mhz19c's UART commands is sparse. It can be reasonably
> thought of that the commands from mhz19b will be supported in mhz19c.
> The mhz19b document mentions all the different commands. Still the
> uncertainity is noted.
> 
> Signed-off-by: Sidharth Seela <sidharthseela@gmail.com>
> ---
>  drivers/iio/chemical/mhz19b.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/iio/chemical/mhz19b.c b/drivers/iio/chemical/mhz19b.c
> index 3c64154918b1..4899aad895d5 100644
> --- a/drivers/iio/chemical/mhz19b.c
> +++ b/drivers/iio/chemical/mhz19b.c
> @@ -297,7 +297,17 @@ static int mhz19b_probe(struct serdev_device *serdev)
>  }
> 
>  static const struct of_device_id mhz19b_of_match[] = {
> +       /* It should be noted that mhz19b is discontinued*/
>         { .compatible = "winsen,mhz19b", },
> +       /* Beware that mhz19c has same pinout, UART characteristics.But there
> +        * are gaps in the official user-manual[1], specifically
> +        * regarding.
> +        *              Calibrate Zero Point.
> +        *              Calibrate Span Point.
> +        *              Detection range setting.

If those are not documented, unless we can definitely confirm they are
present, we should not enable those features for this device.

That means you'll need more substantial driver changes and a chip_info type
structure via the data fields in these firmware match tables.

That structure would have a bunch of boolean flags for features so
we can work out what to turn on for a given part.  We shouldn't expose
any interface that doesn't make sense for a given part.

Jonathan




> +        * Ref [1]:
> https://www.winsen-sensor.com/d/files/infrared-gas-sensor/mh-z19c-pins-type-co2-manual-ver1_0.pdf
> +        */
> +       { .compatible = "winsen,mhz19c", },
>         { }
>  };
>  MODULE_DEVICE_TABLE(of, mhz19b_of_match);
> --
> 2.39.5 (Apple Git-154)


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

end of thread, other threads:[~2025-08-31 15:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-31  8:09 [PATCH v1 2/2] Added mhz19c to compatible list in mhz19b driver Sidharth Seela
2025-08-31 15:36 ` Jonathan Cameron

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).