From: Alexander Holler <holler@ahsoftware.de>
To: linux-kernel@vger.kernel.org
Cc: linux-i2c@vger.kernel.org, Jean Delvare <khali@linux-fr.org>,
Till Harbaum <till@harbaum.org>,
Alexander Holler <holler@ahsoftware.de>
Subject: [PATCH 2/2] i2c: i2c-tiny-usb: Add parameter for optional user-defined devices.
Date: Tue, 13 Nov 2012 19:06:08 +0100 [thread overview]
Message-ID: <1352829968-4908-2-git-send-email-holler@ahsoftware.de> (raw)
In-Reply-To: <1352829968-4908-1-git-send-email-holler@ahsoftware.de>
Now there is an example about how to use this functionality.
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Till Harbaum <till@harbaum.org>
Signed-off-by: Alexander Holler <holler@ahsoftware.de>
---
Documentation/i2c/instantiating-devices | 2 ++
drivers/i2c/busses/i2c-tiny-usb.c | 4 ++++
2 files changed, 6 insertions(+)
diff --git a/Documentation/i2c/instantiating-devices b/Documentation/i2c/instantiating-devices
index 1dbfdf3..783a79f 100644
--- a/Documentation/i2c/instantiating-devices
+++ b/Documentation/i2c/instantiating-devices
@@ -246,3 +246,5 @@ modprobe my_i2c_bus devices=ds1307@0x68,pcf8563@0x51
or even at the kernel command line with
my_i2c_bus.devices=ds1307@0x68,pcf8563@0x51
+
+See the i2c-tiny-usb driver for an exmaple.
diff --git a/drivers/i2c/busses/i2c-tiny-usb.c b/drivers/i2c/busses/i2c-tiny-usb.c
index 0510636..9fd03c6 100644
--- a/drivers/i2c/busses/i2c-tiny-usb.c
+++ b/drivers/i2c/busses/i2c-tiny-usb.c
@@ -40,6 +40,8 @@ module_param(delay, ushort, 0);
MODULE_PARM_DESC(delay, "bit delay in microseconds "
"(default is 10us for 100kHz max)");
+MODULE_PARAM_I2C_OPTIONAL_DEVICES(opt_devices);
+
static int usb_read(struct i2c_adapter *adapter, int cmd,
int value, int index, void *data, int len);
@@ -236,6 +238,8 @@ static int i2c_tiny_usb_probe(struct usb_interface *interface,
/* inform user about successful attachment to i2c layer */
dev_info(&dev->adapter.dev, "connected i2c-tiny-usb device\n");
+ i2c_add_optional_devices(&dev->adapter, opt_devices);
+
return 0;
error:
--
1.7.11.7
next prev parent reply other threads:[~2012-11-13 18:06 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-13 18:06 [PATCH 1/2] i2c: Add possibility for user-defined (i2c-)devices for bus-drivers Alexander Holler
2012-11-13 18:06 ` Alexander Holler [this message]
[not found] ` <1352829968-4908-1-git-send-email-holler-SXC+2es9fhnfWeYVQQPykw@public.gmane.org>
2012-11-13 18:55 ` Jean Delvare
[not found] ` <20121113195533.6db71716-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-11-13 20:23 ` Alexander Holler
2012-11-13 20:52 ` [PATCH] i2c: i2c-tiny-usb: Add parameter for optional i2c-devices Alexander Holler
[not found] ` <1352839940-7559-1-git-send-email-holler-SXC+2es9fhnfWeYVQQPykw@public.gmane.org>
2012-11-13 22:42 ` Alan Cox
[not found] ` <20121113224251.20b52f34-38n7/U1jhRXW96NNrWNlrekiAK3p4hvP@public.gmane.org>
2012-11-13 23:41 ` Alexander Holler
[not found] ` <50A2AC28.7050304-SXC+2es9fhnfWeYVQQPykw@public.gmane.org>
2012-11-13 21:08 ` [PATCH 1/2] i2c: Add possibility for user-defined (i2c-)devices for bus-drivers Jean Delvare
[not found] ` <20121113220835.111a178a-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-11-13 21:24 ` Alexander Holler
[not found] ` <50A2BAA2.6090009-SXC+2es9fhnfWeYVQQPykw@public.gmane.org>
2012-11-13 21:42 ` Jean Delvare
2012-11-13 23:38 ` Alexander Holler
[not found] ` <50A2DA0C.3090507-SXC+2es9fhnfWeYVQQPykw@public.gmane.org>
2012-11-14 9:40 ` Jean Delvare
[not found] ` <20121114104050.79df8cd9-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-11-14 12:38 ` Alexander Holler
[not found] ` <50A390CC.9000208-SXC+2es9fhnfWeYVQQPykw@public.gmane.org>
2012-11-14 19:22 ` till-RcHadlBFbzVAfugRpC6u6w
2012-11-14 23:34 ` Alexander Holler
[not found] ` <1639554.ZUOmHr6Yka@lxtiha>
2012-11-15 11:44 ` Alexander Holler
2012-11-19 13:38 ` Alexander Holler
2012-11-23 14:35 ` Alexander Holler
2012-11-14 2:47 ` Alexander Holler
[not found] ` <50A30652.1020208-SXC+2es9fhnfWeYVQQPykw@public.gmane.org>
2012-11-14 9:08 ` Alexander Holler
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=1352829968-4908-2-git-send-email-holler@ahsoftware.de \
--to=holler@ahsoftware.de \
--cc=khali@linux-fr.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=till@harbaum.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).