30 Nov, 2012
1 commit
-
Currently of_i2c_register_devices() function registers all i2c devices,
independently from their status property in device tree. According to
"ePAPR 1.1" spec, device should only be registered if there is no
"status" property, or it has "ok" (or "okay") value (see
of_device_is_available()). In case of "platform devices",
of_platform_device_create_pdata() checks for "status" and ensures
that disabled devices are not populated. But such check for i2c buses
was missing until now. Fix it.Signed-off-by: Alexander Sverdlin
Acked-by: Rob Herring
Acked-by: Wolfram Sang
Reviewed-by: Barry Song
Signed-off-by: Grant Likely
08 Sep, 2012
1 commit
-
Add support for specifying a generic "wakeup-source" property on i2c
clients, which will set the I2C_CLIENT_WAKE flag, thus configuring the
device to wake the system from suspend (via IRQ).This obviously doesn't make sense on devices lacking IRQ, but since we
still allow that in the i2c_board_info case, I don't see a reason to
restrict it here.Note: Since the generic i2c bindings aren't documented in the kernel,
I didn't find a good place to add documentation for this binding
extension. I still think it makes sense to have a generic property
instead of having each device do its own binding for the same.Signed-off-by: Olof Johansson
Signed-off-by: Rob Herring
12 May, 2012
2 commits
-
This finds the struct i2c_adapter * for a given device tree node. Just
like of_find_i2c_device_by_node.Signed-off-by: Stephen Warren
Signed-off-by: Wolfram Sang -
i2c_bus_type may contain both I2C clients and I2C adapters. Fix
of_find_i2c_device_by_node to call i2c_verify_client to ensure that it
only returns non-NULL of I2C clients.Signed-off-by: Stephen Warren
Acked-by: Rob Herring
Signed-off-by: Wolfram Sang
24 Dec, 2010
1 commit
-
If we are registering an i2c device that has a device tree node like
this real-world example:rtc@68 {
compatible = "dallas,ds1337";
reg = ;
};of_i2c_register_devices() will try to load a module called ds1337.ko.
There is no such module, so it will fail. If we look in modules.alias
we will find entries like these:.
.
.
alias i2c:ds1339 rtc_ds1307
alias i2c:ds1338 rtc_ds1307
alias i2c:ds1337 rtc_ds1307
alias i2c:ds1307 rtc_ds1307
alias i2c:ds1374 rtc_ds1374
.
.
.The module we want is really called rtc_ds1307.ko. If we request a
module called "i2c:ds1337", the userspace module loader will do the
right thing (unless it is busybox) and load rtc_ds1307.ko. So we add
the I2C_MODULE_PREFIX to the request_module() string.Signed-off-by: David Daney
Signed-off-by: Grant Likely
22 Oct, 2010
1 commit
-
The __init directives should go on the definitions of things, not the
declaration, also __init is meaningless for inline functions, so
remove it from prom.h. This allows us to get rid of a useless
#include, but most of the rest of them are useless too, so kill them
as well.If of_i2c.c needs irq definitions, it should include linux/irq.h
directly, not assume indirect inclusion via asm/prom.h.Signed-off-by: David Daney
Acked-by: Ralf Baechle
Signed-off-by: Grant Likely
06 Jul, 2010
1 commit
-
This patch cleans up the i2c OF support code to make it selectable by
all architectures and allow for automatic registration of i2c devices.Signed-off-by: Grant Likely
19 May, 2010
2 commits
-
This patch eliminates the node pointer from struct of_device and the
of_node (or prom_node) pointer from struct dev_archdata since the node
pointer is now part of struct device proper when CONFIG_OF is set, and
all users of the old pointer locations have already been converted over
to use device->of_node.Also remove dev_archdata_{get,set}_node() as it is no longer used by
anything.Signed-off-by: Grant Likely
-
The following structure elements duplicate the information in
'struct device.of_node' and so are being eliminated. This patch
makes all readers of these elements use device.of_node instead.(struct of_device *)->node
(struct dev_archdata *)->prom_node (sparc)
(struct dev_archdata *)->of_node (powerpc & microblaze)Signed-off-by: Grant Likely
29 Apr, 2010
1 commit
-
The struct device_node *of_node pointer is moving out of dev->archdata
and into the struct device proper. of_i2c.c needs to set the of_node
pointer before the device is registered. Since the i2c subsystem
doesn't allow 2 stage allocation and registration of i2c devices, the
of_node pointer needs to be passed via the i2c_board_info structure
so that it is set prior to registration.This patch adds of_node to struct i2c_board_info (conditional on
CONFIG_OF), sets of_node in i2c_new_device(), and modifies of_i2c.c
to use the new parameter. The calling of dev_archdata_set_node()
from of_i2c will be removed in a subsequent patch when of_node is
removed from archdata and all users are converted over.Signed-off-by: Grant Likely
09 Feb, 2010
1 commit
-
Properties in the device tree are specified as big-endian. At present,
the only platforms to support device trees are also big-endian, so we've
been acessing the properties as raw values.We'd like to add device tree support to little-endian platforms too, so
add endian conversion to the sites where we access property values in
the common of code.Compiled on powerpc (ppc44x_defconfig & ppc64_defconfig) and arm (fdt
support only for now).Signed-off-by: Jeremy Kerr
Signed-off-by: Grant Likely
10 Jan, 2009
1 commit
-
The of_find_i2c_device_by_node function allows you to follow a
reference in the device tree to an i2c device node and then locate
the linux device instantiated by the device tree. Example use: an I2S
bus driver finding the i2c_device instance for a codec described by
a device tree node.This was waiting for Anton's i2c patches that were just added.
Signed-off-by: Jon Smirl
Signed-off-by: Grant Likely
03 Dec, 2008
1 commit
-
For I2C devices we just setting the node pointer in the archdata. This
is needed so that the I2C devices could find their OF tree nodes.Signed-off-by: Anton Vorontsov
Acked-by: Grant Likely
Signed-off-by: Paul Mackerras
21 Oct, 2008
1 commit
-
Format string bug. Not exploitable, as this is only writable by root,
but worth fixing all the same.See 326f6a5c9c9e1a62aec37bdc0c3f8d53adabe77b
Signed-off-by: Benjamin Herrenschmidt
26 Jul, 2008
1 commit
-
SPI has a similar problem as I2C in that it needs to determine an
appropriate modalias value for each device node. This patch adapts
the of_i2c of_find_i2c_driver() function to be usable by of_spi also.Signed-off-by: Grant Likely
22 Jul, 2008
1 commit
-
If an I2C device node does not specify an interrupt, the .irq member of the
board_info struct was set to -1. This caused crashes on following
irq_dispose_mappings. Leave it NO_IRQ as returned from irq_of_parse_and_map.
(Suggesting -1 as 'i2c-no-irq' used to be a bug in linux/i2c.h.)Signed-off-by: Wolfram Sang
Acked-by: Sean MacLennan
Signed-off-by: Grant Likely
13 Jul, 2008
1 commit
-
drivers/of/of_i2c.c should include for the prototype
for of_register_i2c_devices().Signed-off-by: Robert P. J. Day
Acked-by: Jean Delvare
Acked-by: Jochen Friedrich
Acked-by: Stephen Rothwell
Signed-off-by: Grant Likely
07 Jun, 2008
1 commit
-
Change the name of the device from "rtc-ds1374" to just "ds1374", to match
what all other RTC drivers do. I seem to remember that this name was
chosen to avoid possible confusion with an older ds1374 driver, but that
driver was removed 3 months ago.Signed-off-by: Jean Delvare
Signed-off-by: Alessandro Zummo
Acked-by: Kumar Gala
Cc: Paul Mackerras
Cc: Benjamin Herrenschmidt
Cc: David Brownell
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
24 Apr, 2008
1 commit
-
After commit 585468e5d5962660867c269e26f0a4b89a599473
([POWERPC] i2c: Fix build breakage introduced by OF helpers)
drivers/of/of_i2c.c needs a MODULE_LICENSE.Signed-off-by: Adrian Bunk
Signed-off-by: Paul Mackerras
20 Apr, 2008
1 commit
-
Fix build breakage introduced in commit "[POWERPC] i2c: OF helpers for
the i2c API". If i2c-core is compiled as a module, the helper needs
to be compiled as a module, as well. Rename i2c.c to of_i2c.c to
avoid name space conflict.[paulus@samba.org: Changed dependency from OF to PPC_OF to avoid
sparc{32,64} allmodconfig breakage.]Signed-off-by: Jochen Friedrich
Signed-off-by: Paul Mackerras