[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aa0b1b37-de0b-c859-5d9b-9de406c770b9@infradead.org>
Date: Thu, 27 Jan 2022 14:39:17 -0800
From: Randy Dunlap <rdunlap@...radead.org>
To: Sami Kyöstilä <skyostil@...omium.org>,
LKML <linux-kernel@...r.kernel.org>
Cc: dtor@...omium.org, evanbenn@...omium.org, arnd@...db.de,
gregkh@...uxfoundation.org
Subject: Re: [PATCH 2/2] drivers/misc: add transfer ioctl for HPS
On 1/27/22 00:35, Sami Kyöstilä wrote:
> This patch adds an ioctl operation for sending and receiving data from
> the ChromeOS snooping protection sensor (a.k.a., HPS). This allows
> userspace programs to perform a combined read/write I2C transaction
> through a single syscall.
>
> The I2C wire protocol for the device is documented at:
>
> https://chromium.googlesource.com/chromiumos/platform/hps-firmware/+/
> refs/heads/main/docs/host_device_i2c_protocol.md
>
> Signed-off-by: Sami Kyöstilä <skyostil@...omium.org>
> ---
>
> MAINTAINERS | 1 +
> drivers/misc/hps-i2c.c | 81 ++++++++++++++++++++++++++++++++++++++++
> include/uapi/linux/hps.h | 20 ++++++++++
> 3 files changed, 102 insertions(+)
> create mode 100644 include/uapi/linux/hps.h
>
Hi--
If your next patch version continues to use an ioctl, its magic "number"
('h') should be documented in Documentation/userspace-api/ioctl/ioctl-number.rst.
thanks.
> diff --git a/include/uapi/linux/hps.h b/include/uapi/linux/hps.h
> new file mode 100644
> index 000000000000..2c1bd174cd02
> --- /dev/null
> +++ b/include/uapi/linux/hps.h
> @@ -0,0 +1,20 @@
> +/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
> +/*
> + * Copyright 2022 Google LLC.
> + */
> +
> +#ifndef _UAPI_HPS_H
> +#define _UAPI_HPS_H
> +
> +#include <linux/types.h>
> +
> +#define HPS_IOC_TRANSFER _IOWR('h', 0x01, struct hps_transfer_ioctl_data)
> +
> +struct hps_transfer_ioctl_data {
> + __u32 isize; /* Number of bytes to send */
> + unsigned char __user *ibuf; /* Input buffer */
> + __u32 osize; /* Number of bytes to receive */
> + unsigned char __user *obuf; /* Output buffer */
> +};
> +
> +#endif /* _UAPI_HPS_H */
--
~Randy
Powered by blists - more mailing lists