linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Matt Ranostay <matt.ranostay@konsulko.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	rishi gupta <gupt21@gmail.com>,
	"open list:IIO SUBSYSTEM AND DRIVERS" <linux-iio@vger.kernel.org>,
	"open list:HID CORE LAYER" <linux-input@vger.kernel.org>
Subject: Re: [PATCH] HID: mcp2221: add ADC support
Date: Sat, 21 Nov 2020 15:10:49 +0000	[thread overview]
Message-ID: <20201121151049.425a7c97@archlinux> (raw)
In-Reply-To: <CAJCx=gkHYsu6=ne2BPCajVP+N9natV3stieP0cKd5nTSC8ARRA@mail.gmail.com>

On Fri, 20 Nov 2020 12:31:23 -0800
Matt Ranostay <matt.ranostay@konsulko.com> wrote:

> On Fri, Nov 20, 2020 at 11:54 AM Lars-Peter Clausen <lars@metafoo.de> wrote:
> >
> > On 11/20/20 8:17 PM, Matt Ranostay wrote:  
> > > On Fri, Nov 20, 2020 at 5:15 AM rishi gupta <gupt21@gmail.com> wrote:  
> > >> On Fri, Nov 20, 2020 at 8:31 AM Matt Ranostay
> > >> <matt.ranostay@konsulko.com> wrote:  
> > >>> Add support for the three 10-bit ADC channels registered via
> > >>> the IIO subsystem.
> > >>>
> > >>> Cc: linux-input@vger.kernel.org
> > >>> Cc: linux-iio@vger.kernel.org
> > >>> CC: Rishi Gupta <gupt21@gmail.com>
> > >>> Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
> > >>> ---
> > >>>   drivers/hid/Kconfig       |  1 +
> > >>>   drivers/hid/hid-mcp2221.c | 65 ++++++++++++++++++++++++++++++++++++++-
> > >>>   2 files changed, 65 insertions(+), 1 deletion(-)
> > >>>
> > >>> diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
> > >>> index 05315b434276..4795744d9979 100644
> > >>> --- a/drivers/hid/Kconfig
> > >>> +++ b/drivers/hid/Kconfig
> > >>> @@ -1157,6 +1157,7 @@ config HID_MCP2221
> > >>>          tristate "Microchip MCP2221 HID USB-to-I2C/SMbus host support"
> > >>>          depends on USB_HID && I2C
> > >>>          depends on GPIOLIB
> > >>> +       depends on IIO  
> > >> I am wondering what will happen on systems which do not enable IIO.
> > >> This driver can not be used there.
> > >> Is my understanding correct?  
> > > Actually yeah this should be "select IIO" to avoid that issue.  
> >
> > No, we should not have a individual driver select a framework. This will
> > cause all kinds of issues with reverse dependencies.
> >
> > It might be worth splitting this driver into a MFD driver, then the MFD
> > cells could have their own module that depend on the subsystem and if
> > not enabled the functionality will not be provided.  
> 
> Would it make sense to use IS_REACHABLE(CONFIG_IIO) for the iio blocks?
> 
> Guessing the weak reference "imply IIO" would still be bad for the
> driver selecting a framework?

A lesser option than going full MFD for this (which is probably the
right design decision but is a big change) would be to just put the
IIO stuff in a separate C file and use some build time magic.

I agree with Lars though that this is probably better done as an MFD.
It supports a bunch of things in entirely different subsystems afterall.

Jonathan

> 
> Thanks,
> 
> Matt
> 
> >
> > - Lars
> >  


      reply	other threads:[~2020-11-21 15:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-20  3:01 [PATCH] HID: mcp2221: add ADC support Matt Ranostay
2020-11-20 13:14 ` rishi gupta
2020-11-20 19:17   ` Matt Ranostay
2020-11-20 19:54     ` Lars-Peter Clausen
2020-11-20 20:31       ` Matt Ranostay
2020-11-21 15:10         ` Jonathan Cameron [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=20201121151049.425a7c97@archlinux \
    --to=jic23@kernel.org \
    --cc=gupt21@gmail.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=matt.ranostay@konsulko.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).