linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guillermo Rodriguez Garcia <guille.rodriguez@gmail.com>
To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Cc: Christoph Hellwig <hch@lst.de>, Al Viro <viro@zeniv.linux.org.uk>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Luis Chamberlain <mcgrof@kernel.org>,
	Matthew Wilcox <willy@infradead.org>,
	Kees Cook <keescook@chromium.org>,
	Iurii Zaikin <yzaikin@google.com>
Subject: fs: layered device driver to write to evdev
Date: Wed, 2 Nov 2022 14:14:24 +0100	[thread overview]
Message-ID: <CABDcava_0n2-WdyW6xO-18hTPNLpdnGVGoMY4QtPhnEVYT90-w@mail.gmail.com> (raw)
In-Reply-To: <CABDcava8ADBNrVNh+7A2jG-LgEipcapU8dVh8p+jX-D4kgfzRg@mail.gmail.com>

Hi all,

I have a number of embedded boards that integrate a pwm-based buzzer
device, and use the pwm-beeper device driver in order to control this.

However the pwm-beeper device driver only supports simple (play /
stop) ioctls, so I had implemented a "layered" device driver that
would talk to the pwm-beeper device (through evdev), and provide
additional ioctls to userspace so that an application could say e.g.
"beep for 50ms", and the driver would take care of the timing.

This layered device driver used set_fs + vfs_write to talk to the
underlying device. However, since [1] this no longer works.

I understand that device drivers should implement ->write_iter if they
need to be written from kernel space, but evdev does not support this.
What is the recommended way to have a layered device driver that can
talk to evdev ?

Thanks in advance,

(If possible, please CC me in any replies)

 [1]: https://lore.kernel.org/lkml/20200626075836.1998185-9-hch@lst.de/

-- 
Guillermo Rodriguez Garcia
guille.rodriguez@gmail.com

       reply	other threads:[~2022-11-02 13:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CABDcava8ADBNrVNh+7A2jG-LgEipcapU8dVh8p+jX-D4kgfzRg@mail.gmail.com>
2022-11-02 13:14 ` Guillermo Rodriguez Garcia [this message]
2022-11-02 22:19   ` fs: layered device driver to write to evdev Eric Biggers
2022-11-03  0:04   ` Luis Chamberlain
2022-11-03  7:47     ` Christoph Hellwig
2022-11-03  8:22     ` Guillermo Rodriguez Garcia

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=CABDcava_0n2-WdyW6xO-18hTPNLpdnGVGoMY4QtPhnEVYT90-w@mail.gmail.com \
    --to=guille.rodriguez@gmail.com \
    --cc=hch@lst.de \
    --cc=keescook@chromium.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.org \
    --cc=yzaikin@google.com \
    /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 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).