kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* maintainer for this update?
@ 2019-03-28 21:53 Dave Stevens
  2019-03-28 22:28 ` Greg KH
  2019-03-29  3:22 ` Valdis Klētnieks
  0 siblings, 2 replies; 3+ messages in thread
From: Dave Stevens @ 2019-03-28 21:53 UTC (permalink / raw)
  To: kernelnewbies

In the article below about kernel updates is a reference to a driver for
a Plantower PMS7003 particulate matter sensor. I'm using this series in
air pollution monitoring and its usual interface to the computer
is over a serial line. I consequently am very curious about how and why
it would need a specific kernel module.

Can anyone refer me to more information about the originator of this
patch? I'd rather ask directly but don't know how to go about it.

TIA

Dave


https://lwn.net/Articles/782511/

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

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

* Re: maintainer for this update?
  2019-03-28 21:53 maintainer for this update? Dave Stevens
@ 2019-03-28 22:28 ` Greg KH
  2019-03-29  3:22 ` Valdis Klētnieks
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2019-03-28 22:28 UTC (permalink / raw)
  To: Dave Stevens; +Cc: kernelnewbies

On Thu, Mar 28, 2019 at 02:53:28PM -0700, Dave Stevens wrote:
> In the article below about kernel updates is a reference to a driver for
> a Plantower PMS7003 particulate matter sensor. I'm using this series in
> air pollution monitoring and its usual interface to the computer
> is over a serial line. I consequently am very curious about how and why
> it would need a specific kernel module.
> 
> Can anyone refer me to more information about the originator of this
> patch? I'd rather ask directly but don't know how to go about it.

scripts/get_maintainer.pl is your friend :)

It can be used on any kernel file to find out who is responsible for it.

hope this helps,

greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

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

* Re: maintainer for this update?
  2019-03-28 21:53 maintainer for this update? Dave Stevens
  2019-03-28 22:28 ` Greg KH
@ 2019-03-29  3:22 ` Valdis Klētnieks
  1 sibling, 0 replies; 3+ messages in thread
From: Valdis Klētnieks @ 2019-03-29  3:22 UTC (permalink / raw)
  To: Dave Stevens; +Cc: kernelnewbies

On Thu, 28 Mar 2019 14:53:28 -0700, Dave Stevens said:
> In the article below about kernel updates is a reference to a driver for
> a Plantower PMS7003 particulate matter sensor. I'm using this series in
> air pollution monitoring and its usual interface to the computer
> is over a serial line. I consequently am very curious about how and why
> it would need a specific kernel module.

A quick look at the driver shows that it apparently does at least
a little bit of the heavy lifting for you - rather than you have to do all the
serial I/O interpretation yourself in userspace, it will handle checksums and
channels and so on for you.

+enum pms7003_cmd {
+       CMD_WAKEUP,
+       CMD_ENTER_PASSIVE_MODE,
+       CMD_READ_PASSIVE,
+       CMD_SLEEP,
+};
+
+/*
+ * commands have following format:
+ *
+ * +------+------+-----+------+-----+-----------+-----------+
+ * | 0x42 | 0x4d | cmd | 0x00 | arg | cksum msb | cksum lsb |
+ * +------+------+-----+------+-----+-----------+-----------+
+ */
+static const u8 pms7003_cmd_tbl[][PMS7003_CMD_LENGTH] = {
+       [CMD_WAKEUP] = { 0x42, 0x4d, 0xe4, 0x00, 0x01, 0x01, 0x74 },
+       [CMD_ENTER_PASSIVE_MODE] = { 0x42, 0x4d, 0xe1, 0x00, 0x00, 0x01, 0x70 },
+       [CMD_READ_PASSIVE] = { 0x42, 0x4d, 0xe2, 0x00, 0x00, 0x01, 0x71 },
+       [CMD_SLEEP] = { 0x42, 0x4d, 0xe4, 0x00, 0x00, 0x01, 0x73 },
+};

So you can send 'wakeup' or 'read' and it will send the strings, and
then read back data and complete the I/O when enough bytes have
arrived.

There's also some probing in there to deal with device tree etc.

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

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

end of thread, other threads:[~2019-03-29  3:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-28 21:53 maintainer for this update? Dave Stevens
2019-03-28 22:28 ` Greg KH
2019-03-29  3:22 ` Valdis Klētnieks

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