mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Stephen Boyd <swboyd@chromium.org>
Cc: Jiri Kosina <jikos@kernel.org>,
	Zhengqiao Xia <xiazhengqiao@huaqin.corp-partner.google.com>,
	benjamin.tissoires@redhat.com, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org, dianders@chromium.org,
	Wei-Ning Huang <wnhuang@google.com>,
	Nicolas Boichat <drinkcat@chromium.org>,
	Sean O'Brien <seobrien@chromium.org>,
	phoenixshen@chromium.org
Subject: Re: [PATCH v2] HID: google: modify HID device groups of eel
Date: Fri, 14 Jan 2022 13:40:18 -0800	[thread overview]
Message-ID: <YeHtwsmKzqhU4Fiq@google.com> (raw)
In-Reply-To: <CAE-0n51TAtifbbruKhCJ_u5xH1j0zKjWOehGQFFdCez=RubxVA@mail.gmail.com>

On Fri, Jan 14, 2022 at 02:55:49PM -0600, Stephen Boyd wrote:
> Quoting Dmitry Torokhov (2022-01-14 11:59:50)
> > On Fri, Jan 14, 2022 at 01:25:12PM -0600, Stephen Boyd wrote:
> > >
> > > My understanding is that 'vivaldi' is mostly a keyboard layout and
> > > 'hammer' is a detachable keyboard. We want to prevent the hid-vivaldi
> > > driver from probing this particular device because the hid-vivaldi
> > > driver doesn't know about detachable keyboards. Hammer devices also
> > > support 360 degree wraparound so we know that the keyboard has been put
> > > behind the screen or that it's being used to stand up the device on a
> > > table.
> > >
> > > Given all that, I'm still confused. If we make the hid-google-hammer
> > > driver probe this device and the keyboard layout is vivaldi then we'd
> > > want the part of the vivaldi driver that exposes the
> > > function_row_physmap through sysfs. Otherwise userspace won't know how
> > > to handle the function row properly. I think we need the device to stack
> > > two drivers here. Does that happen with HID?
> >
> > As far as I know HID does not easily allow "stacking" drivers like that.
> 
> Ok.
> 
> >
> > Probably the easiest way would be to export vivaldi_feature_mapping()
> > and the show method for the physical row map and call them from the
> > hammer driver.
> >
> 
> I worry about builtin vs. modular drivers so probably ought to make some

Just make hid-hammer depend on hid-vivaldi, hid-vivaldi is tiny
otherwise.

> hid-vivaldi-common.c file that has the physmap code and then have both
> drivers call that mini-library. The 'vivaldi_data' structure would need
> to be figured out too. The hammer driver stores 'hammer_kbd_leds' in the
> hid_get_drvdata() whereas the vivaldi driver stores 'vivalid_data' so we
> can't simply call the show method for the sysfs attribute without some
> minor surgery.

Yeah, we'll need to convert them into helpers into which callers can
pass buffers.

Thanks.

-- 
Dmitry

  reply	other threads:[~2022-01-14 21:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-07  9:13 Zhengqiao Xia
2022-01-07  9:31 ` Zhengqiao Xia
2022-01-14  8:38 ` Jiri Kosina
2022-01-14 19:25   ` Stephen Boyd
2022-01-14 19:59     ` Dmitry Torokhov
2022-01-14 20:55       ` Stephen Boyd
2022-01-14 21:40         ` Dmitry Torokhov [this message]
2022-01-14 11:33 ` Re " xiazhengqiao

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=YeHtwsmKzqhU4Fiq@google.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=dianders@chromium.org \
    --cc=drinkcat@chromium.org \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=phoenixshen@chromium.org \
    --cc=seobrien@chromium.org \
    --cc=swboyd@chromium.org \
    --cc=wnhuang@google.com \
    --cc=xiazhengqiao@huaqin.corp-partner.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

Powered by JetHome