lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1352829968-4908-2-git-send-email-holler@ahsoftware.de>
Date:	Tue, 13 Nov 2012 19:06:08 +0100
From:	Alexander Holler <holler@...oftware.de>
To:	linux-kernel@...r.kernel.org
Cc:	linux-i2c@...r.kernel.org, Jean Delvare <khali@...ux-fr.org>,
	Till Harbaum <till@...baum.org>,
	Alexander Holler <holler@...oftware.de>
Subject: [PATCH 2/2] i2c: i2c-tiny-usb: Add parameter for optional user-defined devices.

Now there is an example about how to use this functionality.

Cc: Jean Delvare <khali@...ux-fr.org>
Cc: Till Harbaum <till@...baum.org>
Signed-off-by: Alexander Holler <holler@...oftware.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@...8,pcf8563@...1
 or even at the kernel command line with
 
 my_i2c_bus.devices=ds1307@...8,pcf8563@...1
+
+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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ