devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Simon Glass <sjg@chromium.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Samuel Ortiz <sameo@linux.intel.com>,
	Luigi Semenzato <semenzato@chromium.org>,
	Vincent Palatin <vpalatin@chromium.org>,
	Grant Likely <grant.likely@secretlab.ca>,
	Rob Herring <rob.herring@calxeda.com>,
	Rob Landley <rob@landley.net>, Felipe Balbi <balbi@ti.com>,
	Sourav Poddar <sourav.poddar@ti.com>,
	Tony Lindgren <tony@atomide.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Mike A. Chan" <mikechan@google.com>,
	Jun Nakajima <jun.nakajima@intel.com>,
	Tom Keel <thomas.keel@intel.com>,
	devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org,
	linux-input@vger.kernel.org
Subject: Re: [PATCH v2 6/6] Input: Add ChromeOS EC keyboard driver
Date: Thu, 14 Feb 2013 09:31:28 -0800	[thread overview]
Message-ID: <20130214173127.GC4007@core.coreip.homeip.net> (raw)
In-Reply-To: <CAPnjgZ2-QV36Ro_G32kcHStpj0SCC_gDoeCPqjN-h6bsBTSGvQ@mail.gmail.com>

On Wed, Feb 13, 2013 at 10:45:07PM -0800, Simon Glass wrote:
> >>
> >> +config KEYBOARD_CROS_EC
> >> +     tristate "ChromeOS EC keyboard"
> >> +     select INPUT_MATRIXKMAP
> >> +     select MFD_CROS_EC
> >
> > Is this select safe? I.e. does MFD_CROS_EC depend on anything else?
> 
> I'll remove it, since it isn't required, and it's true that it does
> need other things.

Instead of droppign the dependency completely I think it should "depens
on MFD_CROS_EC"

> >> +
> >> +static void cros_ec_keyb_close(struct input_dev *dev)
> >> +{
> >> +     struct cros_ec_keyb *ckdev = input_get_drvdata(dev);
> >> +
> >> +     blocking_notifier_chain_unregister(&ckdev->ec->event_notifier,
> >> +                                        &ckdev->notifier);
> >> +     blocking_notifier_chain_unregister(&ckdev->ec->wake_notifier,
> >> +                                        &ckdev->wake_notifier);
> >
> > Why is this done via a notifier instead of regular resume method?
> 
> Because we only call the notifer in resume when we were not waking on
> a keyboard event. We use it to flush the keyboard. It was a late
> change so there might be a better way, but this driver does not have a
> resume handler.

Right and the question is why does not it have resume handler and why
you inventing your own resume infrastructure instead of using the
standard one.

> >> +
> >> +static int cros_ec_keyb_probe(struct platform_device *pdev)
> >> +{
> >> +     struct cros_ec_device *ec = dev_get_drvdata(pdev->dev.parent);
> >> +     struct device *dev = ec->dev;
> >> +     struct cros_ec_keyb *ckdev = NULL;
> >> +     struct input_dev *idev = NULL;
> >> +     struct device_node *np;
> >> +     int err;
> >> +
> >> +     np = of_find_matching_node(NULL, cros_ec_kbc_of_match);
> >
> > And if we don't find it?
> 
> Added error checking.
> 
> >
> >> +
> >> +     ckdev = kzalloc(sizeof(*ckdev), GFP_KERNEL);
> >> +     if (!ckdev) {
> >> +             dev_err(dev, "cannot allocate memory for ckdev\n");
> >> +             return -ENOMEM;
> >> +     }
> >> +     pdev->dev.of_node = np;
> >
> > Huh? I'd expect the platform device be fully set up (including DT data)
> > before the driver is called.
> 
> This is a child of the mfd driver cros_ec, so I don't think that
> works. Or maybe I'm just not sure how to plumb it in so it is
> automatic. Or maybe I just need to add the id to the device info
> below?

Who creates this device? Whoever does this should set up the
pdev->dev.of_node. This is not this driver's responsibility.

And then you add the id to the table below and matching is done
automatically.

Thanks.

-- 
Dmitry

  reply	other threads:[~2013-02-14 17:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-13  2:42 [PATCH v2 0/6] Add ChromeOS Embedded Controller support Simon Glass
     [not found] ` <1360723347-28701-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2013-02-13  2:42   ` [PATCH v2 2/6] mfd: Add ChromeOS EC implementation Simon Glass
2013-02-13  3:35     ` Joe Perches
2013-02-16  3:58       ` Simon Glass
2013-02-13  2:42 ` [PATCH v2 6/6] Input: Add ChromeOS EC keyboard driver Simon Glass
2013-02-13 20:02   ` Dmitry Torokhov
     [not found]     ` <20130213200232.GB22031-WlK9ik9hQGAhIp7JRqBPierSzoNAToWh@public.gmane.org>
2013-02-14  6:45       ` Simon Glass
2013-02-14 17:31         ` Dmitry Torokhov [this message]
2013-02-16  3:56           ` Simon Glass

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=20130214173127.GC4007@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=balbi@ti.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=gregkh@linuxfoundation.org \
    --cc=jun.nakajima@intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikechan@google.com \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=sameo@linux.intel.com \
    --cc=semenzato@chromium.org \
    --cc=sjg@chromium.org \
    --cc=sourav.poddar@ti.com \
    --cc=thomas.keel@intel.com \
    --cc=tony@atomide.com \
    --cc=vpalatin@chromium.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 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).