linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
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: Fri, 15 Feb 2013 19:56:56 -0800	[thread overview]
Message-ID: <CAPnjgZ2aPJdn8jcSjdYmUoqgh2Z8oVCoCZFfmV5g5NQ80seB0w@mail.gmail.com> (raw)
In-Reply-To: <20130214173127.GC4007@core.coreip.homeip.net>

Hi Dmitry,

On Thu, Feb 14, 2013 at 9:31 AM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> 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"

OK, done.

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

I will fix that.

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

OK I see - it comes from mfd and it is easy enough to make it do the
right thing.

Thanks for your comments and patience. I will send a new patch.

Regards,
Simon

>
> Thanks.
>
> --
> Dmitry

      reply	other threads:[~2013-02-16  3:56 UTC|newest]

Thread overview: 16+ 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
2013-02-13  2:42 ` [PATCH v2 1/6] mfd: Add ChromeOS EC messages header Simon Glass
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 3/6] mfd: Add ChromeOS EC I2C driver Simon Glass
2013-02-13  2:42 ` [PATCH v2 4/6] mfd: Add ChromeOS EC SPI driver Simon Glass
2013-02-13  2:42 ` [PATCH v2 5/6] Input: matrix-keymap: Add function to read the new DT binding Simon Glass
2013-02-13  5:32   ` a0131647
2013-02-13 19:43   ` Dmitry Torokhov
2013-02-14  5:40     ` 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
2013-02-14  6:45     ` Simon Glass
2013-02-14 17:31       ` Dmitry Torokhov
2013-02-16  3:56         ` Simon Glass [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=CAPnjgZ2aPJdn8jcSjdYmUoqgh2Z8oVCoCZFfmV5g5NQ80seB0w@mail.gmail.com \
    --to=sjg@chromium.org \
    --cc=balbi@ti.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=dmitry.torokhov@gmail.com \
    --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=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).