All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sami Kyostila <skyostil@chromium.org>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	dtor@chromium.org, evanbenn@chromium.org, arnd@arndb.de,
	gregkh@linuxfoundation.org
Subject: Re: [PATCH 2/2] drivers/misc: add transfer ioctl for HPS
Date: Fri, 28 Jan 2022 18:42:31 +1100	[thread overview]
Message-ID: <CAPuLczt0Oo-tWZQDLe_g6JNvR9Dqa3wpKUjzMAv+goOV64DNyA@mail.gmail.com> (raw)
In-Reply-To: <aa0b1b37-de0b-c859-5d9b-9de406c770b9@infradead.org>

pe 28. tammik. 2022 klo 9.39 Randy Dunlap (rdunlap@infradead.org) kirjoitti:
>
>
>
> 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@chromium.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.

Ah, thanks for the pointer. Will do.


- Sami

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

      reply	other threads:[~2022-01-28  7:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27  8:35 [PATCH 0/2] Add a driver for the ChromeOS snooping protection sensor (HPS) Sami Kyöstilä
2022-01-27  8:35 ` [PATCH 1/2] drivers/misc: add a driver for HPS Sami Kyöstilä
2022-01-27  9:40   ` Greg KH
2022-01-28  7:41     ` Sami Kyostila
2022-01-28  9:36       ` Greg KH
2022-02-18 17:20   ` Pavel Machek
2022-01-27  8:35 ` [PATCH 2/2] drivers/misc: add transfer ioctl " Sami Kyöstilä
2022-01-27  9:41   ` Greg KH
2022-01-28  7:42     ` Sami Kyostila
2022-01-28  9:36       ` Greg KH
2022-01-31  8:23         ` Sami Kyostila
2022-01-31 12:51           ` Arnd Bergmann
2022-01-28  9:47       ` Arnd Bergmann
2022-01-27 22:39   ` Randy Dunlap
2022-01-28  7:42     ` Sami Kyostila [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPuLczt0Oo-tWZQDLe_g6JNvR9Dqa3wpKUjzMAv+goOV64DNyA@mail.gmail.com \
    --to=skyostil@chromium.org \
    --cc=arnd@arndb.de \
    --cc=dtor@chromium.org \
    --cc=evanbenn@chromium.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.