Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1469791
| Path | csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Rob Herring <robh@kernel.org> |
| Newsgroups | linux.kernel |
| Subject | [RFC PATCH 1/6] serio: add OF driver binding |
| Date | Thu, 25 Aug 2016 01:30:02 +0200 |
| Message-ID | <s9PMm-17y-29@gated-at.bofh.it> (permalink) |
| References | <s9PMm-17y-3@gated-at.bofh.it> |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sxl3CJMQaMF8MraYa6hkvMFLDFkyOB96sPejGEirxWk=; b=m3TzfWnrf6W5f1761VI7v5NL6/yxzCev/9Vuxqocix1kGcdvsefBwfxlvjTcjwyRXu agvsIkbkETJnmVQVDeVBS6Ex3j/fBsIrfk7VOVaexJo8iaLyAJoS9+UTPVSPGhsEVbaF kE28zBJfIgNRq8+00h4CvP+AfH3UcvYwqjsDU3gAzkNxquaPZbKWma/jBjbZXdA76x3d pyPCL+DwtN2zhL1EhLUr/6iMPYQB1rMvHs1H0Oh+ee1OolDPQw+VcX4z/W2XI7G0c4Ak QvNeC2mMFJtpmLCl6eiDfS2oiUUqZ+gzDmo3p9TiVXNF2vbJJ29LqdF//4Wd1vZqFvRV Kmgg== |
| X-Gm-Message-State | AE9vXwOkTrxhWQWh0IVEoHsCYCpONNJrExhp9fjX8MLO40uVXsDw+j0XmscA4pIiVSt9rA== |
| X-Received | by 10.157.32.46 with SMTP id n43mr4591849ota.120.1472081082085; Wed, 24 Aug 2016 16:24:42 -0700 (PDT) |
| X-Mailer | git-send-email 2.9.3 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 96 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Loic Poulain <loic.poulain@intel.com>, Pavel Machek <pavel@ucw.cz>, Peter Hurley <peter@hurleysoftware.com>, NeilBrown <neil@brown.name>, Linus Walleij <linus.walleij@linaro.org>, linux-bluetooth@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org |
| X-Original-Date | Wed, 24 Aug 2016 18:24:32 -0500 |
| X-Original-Message-ID | <20160824232437.9446-3-robh@kernel.org> |
| X-Original-References | <20160824232437.9446-1-robh@kernel.org> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1469791 |
Show key headers only | View raw
Signed-off-by: Rob Herring <robh@kernel.org>
---
drivers/input/serio/serio.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index 1ca7f55..6cfa22f 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -36,6 +36,7 @@
#include <linux/slab.h>
#include <linux/workqueue.h>
#include <linux/mutex.h>
+#include <linux/of_device.h>
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("Serio abstraction core");
@@ -88,7 +89,7 @@ static void serio_disconnect_driver(struct serio *serio)
static int serio_match_port(const struct serio_device_id *ids, struct serio *serio)
{
- while (ids->type || ids->proto) {
+ while (ids && (ids->type || ids->proto)) {
if ((ids->type == SERIO_ANY || ids->type == serio->id.type) &&
(ids->proto == SERIO_ANY || ids->proto == serio->id.proto) &&
(ids->extra == SERIO_ANY || ids->extra == serio->id.extra) &&
@@ -107,6 +108,7 @@ static int serio_bind_driver(struct serio *serio, struct serio_driver *drv)
{
int error;
+ printk("%s\n", __func__);
if (serio_match_port(drv->id_table, serio)) {
serio->dev.driver = &drv->driver;
@@ -133,6 +135,7 @@ static void serio_find_driver(struct serio *serio)
{
int error;
+ printk("%s\n", __func__);
error = device_attach(&serio->dev);
if (error < 0 && error != -EPROBE_DEFER)
dev_warn(&serio->dev,
@@ -542,8 +545,12 @@ static void serio_init_port(struct serio *serio)
static void serio_add_port(struct serio *serio)
{
struct serio *parent = serio->parent;
+ struct device_node *parent_node =
+ serio->dev.parent ? serio->dev.parent->of_node : NULL;
int error;
+ printk("%s\n", __func__);
+
if (parent) {
serio_pause_rx(parent);
list_add_tail(&serio->child_node, &parent->children);
@@ -555,6 +562,8 @@ static void serio_add_port(struct serio *serio)
if (serio->start)
serio->start(serio);
+ serio->dev.of_node = of_get_next_available_child(parent_node, NULL);
+
error = device_add(&serio->dev);
if (error)
dev_err(&serio->dev,
@@ -570,6 +579,8 @@ static void serio_destroy_port(struct serio *serio)
{
struct serio *child;
+ printk("%s\n", __func__);
+
while ((child = serio_get_pending_child(serio)) != NULL) {
serio_remove_pending_events(child);
put_device(&child->dev);
@@ -791,6 +802,7 @@ static int serio_driver_probe(struct device *dev)
struct serio *serio = to_serio_port(dev);
struct serio_driver *drv = to_serio_driver(dev->driver);
+ printk("%s\n", __func__);
return serio_connect_driver(serio, drv);
}
@@ -902,6 +914,12 @@ static int serio_bus_match(struct device *dev, struct device_driver *drv)
struct serio *serio = to_serio_port(dev);
struct serio_driver *serio_drv = to_serio_driver(drv);
+ printk("%s\n", __func__);
+
+ if (of_driver_match_device(dev, drv)) {
+ printk("matched %s\n", dev->of_node->name);
+ return 1;
+ }
if (serio->manual_bind || serio_drv->manual_bind)
return 0;
--
2.9.3
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RFC PATCH 0/6] UART slave devices using serio Rob Herring <robh@kernel.org> - 2016-08-25 01:30 +0200
[RFC PATCH 5/6] serio: add serial configuration functions Rob Herring <robh@kernel.org> - 2016-08-25 01:30 +0200
[RFC PATCH 4/6] serio: serport: add support for buffered write and receive Rob Herring <robh@kernel.org> - 2016-08-25 01:30 +0200
Re: [RFC PATCH 4/6] serio: serport: add support for buffered write and receive Pavel Machek <pavel@ucw.cz> - 2016-08-26 22:20 +0200
Re: [RFC PATCH 4/6] serio: serport: add support for buffered write and receive Rob Herring <robh@kernel.org> - 2016-08-26 23:40 +0200
Re: [RFC PATCH 4/6] serio: serport: add support for buffered write and receive Pavel Machek <pavel@ucw.cz> - 2016-08-27 00:30 +0200
[RFC PATCH 1/6] serio: add OF driver binding Rob Herring <robh@kernel.org> - 2016-08-25 01:30 +0200
[RFC PATCH 1/6] serio: add DT driver binding Rob Herring <robh@kernel.org> - 2016-08-25 01:30 +0200
Re: [RFC PATCH 1/6] serio: add DT driver binding Pavel Machek <pavel@ucw.cz> - 2016-08-29 12:00 +0200
[RFC PATCH 6/6] bluetooth: hack up ldisc to use serio Rob Herring <robh@kernel.org> - 2016-08-25 01:30 +0200
Re: [RFC PATCH 0/6] UART slave devices using serio Pavel Machek <pavel@ucw.cz> - 2016-08-26 22:10 +0200
Re: [RFC PATCH 0/6] UART slave devices using serio Rob Herring <robh@kernel.org> - 2016-08-26 23:40 +0200
csiph-web